Skip to content

docs(profiler): stage 0 design contracts for backend redesign#708

Draft
vlsi wants to merge 2 commits into
Netcracker:mainfrom
vlsi:docs/profiler-stage0-design-contracts
Draft

docs(profiler): stage 0 design contracts for backend redesign#708
vlsi wants to merge 2 commits into
Netcracker:mainfrom
vlsi:docs/profiler-stage0-design-contracts

Conversation

@vlsi
Copy link
Copy Markdown
Collaborator

@vlsi vlsi commented May 4, 2026

Summary

  • Roadmap for the profiler-backend redesign in profiler-plan.md: six stages, with stage 0 (contracts and diagrams) as the gate. Captures decisions from the team discussion and follow-up Q&A: no Postgres in prod, single Go binary, RWX-PV not required, contracts-first development.
  • First contract document backend/docs/design/01-write-contract.md: what the new Go collector writes — dictionary WAL, trace stream cache, parquet schema, local PV layout, S3 layout, flush semantics, configuration.
  • Stage 0 tracker backend/docs/design/stage0-progress.md: checklist plus append-only decisions log for the contract phase.
  • Index backend/docs/design/README.md: pointer to the five contract docs (only Add initial source code #1 is drafted; Add issues and PR templates #2Fix links in README.md #5 are TBD).

Why draft

Stage 1 cannot start until items V1–V6 in 01-write-contract.md are confirmed against the agent code (agent/, dumper/, runtime/). Posting as draft to collect that input. Three more design docs (read contract, lifecycle, storage layout) and the Mermaid diagrams are still pending.

Open decisions called out in the docs

  • trace_id column shape in the parquet schema: single string vs three integers (01-write-contract.md Section 5.3 Q-A).
  • Default config values: memory budget, trace cache size, duration buckets (01-write-contract.md Section 9).
  • Verifications V1–V6 about agent wire behavior (Section 1).

Test plan

  • Review V1–V6 against agent code
  • Decide trace_id column shape (string vs three ints)
  • Sanity-check default config values
  • Approve write contract before stage 1 begins

🤖 Generated with Claude Code

vlsi and others added 2 commits May 4, 2026 14:33
Plans the move from collector→Postgres→maintenance→parquet to a single
Go binary that demultiplexes agent streams, persists them via local
WAL + trace cache, ships parquet to S3, and serves queries via fan-out
+ merge across collector replicas plus S3.

Adds:
  - profiler-plan.md (root): roadmap, stages 0–6, decisions log,
    code map.
  - backend/docs/design/README.md: index of contract docs and a
    summary of decisions.
  - backend/docs/design/stage0-progress.md: stage 0 tracker
    (markdown checklist) and append-only decisions log.
  - backend/docs/design/01-write-contract.md: first draft —
    dictionary WAL, trace stream cache, parquet schema, local PV
    layout, S3 layout, flush semantics, configuration.

Stage 1 implementation is blocked on review of items V1–V6 in
01-write-contract.md, which describe agent-side wire behavior the
author has not yet confirmed in agent/, dumper/, runtime/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…the write contract

- Translates the work plan to English to match the project policy
  (CLAUDE.md: "Use English for newly created documents").
- Aligns Stage 1 with the write contract: the agent protocol parser
  reused from `backend/libs/parser/parser.go` (Go), not from the Java
  collector. Raw trace bytes are persisted via a trace stream cache on
  local PV, replacing the earlier "spill-to-SQLite" sketch (the
  collector never assembles partial calls — see 01-write-contract.md
  Section 1).
- Decision #2 in the "Decisions taken" section now reflects the agreed
  outcome: the new collector is written in Go and the Java collector
  is removed after Stage 4.
- Appendix A points to both the Java collector (legacy) and the Go
  parser (future) for the TCP-stream-receiver row.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant