Skip to content

feat: split SRS into product requirements vs technical specs (srs-improved.md)#1

Open
paologaleotti wants to merge 8 commits into
buildo:mainfrom
paologaleotti:feat/redattore-srs-improved
Open

feat: split SRS into product requirements vs technical specs (srs-improved.md)#1
paologaleotti wants to merge 8 commits into
buildo:mainfrom
paologaleotti:feat/redattore-srs-improved

Conversation

@paologaleotti

@paologaleotti paologaleotti commented Jun 15, 2026

Copy link
Copy Markdown

What

Adds an editor step that runs in parallel with the final report and produces a derivative deliverable, srs-improved.md. Every [Work Item N] section is restructured into two subsections and enriched with the behaviors the reverse-diff found in code but missing from the SRS:

  • Requisiti di prodotto — an authored, grounded product view: user need, feature goal, observable behavior/outcome and business rules.
  • Specifiche tecniche — the faithful technical view: endpoints, events, db entities, validations, merge/migration ordering, implementation notes.

Output is markdown for manual import into a new Confluence page (Insert > Markup > Markdown) — the original page is never touched.

This PR also renames all workflow roles to English (cartographer, crawler, analyzer, verifier, reverse-scout, editor) and writes every prompt in English (deliverables stay Italian on purpose).

How — editor sub-pipeline

The editor is itself a small pipeline (runs concurrently with the report):

2 haiku readers (parallel)            sonnet               sonnet (read-only)        sonnet
  • SRS digest                ─┐
  • reverse-diff extract      ─┴──▶  converge  ──▶  adversarial verify  ──▶  one rework (on 'revise')
                                     writes srs-improved.md      falsifies it
  • Two haiku readers do the cheap extraction (faithful per-WI technical content + product-intent sentences + verbatim product-context sections; reverse-diff behaviors with a spec-worthiness flag).
  • Sonnet converge authors the document from both digests.
  • Independent adversarial verifier (read-only) tries to falsify the result and returns objections in-band; on revise a single rework fixes the file. No separate review artifact.

Key behaviors

  • Two derived views, asymmetric fidelity. The technical view is lossless/faithful (no technical fact dropped or invented); the product view may rephrase/condense but every claim must trace to the SRS (Overview / Vincoli / Assunzioni / UI-UX / WI intent). A purely-technical WI gets an explicit _(nessun requisito di prodotto dedicato: WI tecnico/abilitante)_ marker instead of padding.
  • No code references in the document. File paths and line numbers are stripped (they churn over time); code snippets, event names, db entities/tables/columns and API endpoints are kept.
  • Reverse-diff enrichment with a spec-worthiness filter. Contract / business-rule / error-semantics behaviors are merged into the relevant Work Item (phrased as requirements, not diff notes); incidental implementation details (internal status codes, in-memory optimizations, signer skips) go to a clearly-labeled ## Rilievi implementativi (non requisiti) appendix. Every added line carries a provenance marker _(da reverse-diff — presente nel codice, assente nell'SRS originale)_.
  • Budget-gated skip-with-flag like the other optional roles; surfaced in RR-5.

Why

The SRS mixes product intent and implementation detail in the same paragraphs. Splitting them into a real product view vs a faithful technical view lets a PO validate behavior without parsing DDL, while the reverse-diff enrichment surfaces undocumented behavior the spec should capture. The independent adversarial verify keeps the rewrite honest (no dropped technical facts, no invented product claims, no code references, correctly-placed enrichment).

Validation

Test run against pagopa/interop-be-monorepo@develop (epic PIN-8621, SRS = "DRAFT SRS Link Template EService-Agevolata"), 10 analysis units:

  • srs-improved.md regenerated with 0 code references, genuine product subsections, honest "nessun requisito" markers on technical-only WIs.
  • Reverse-diff behaviors split into requirements vs the implementation-notes appendix; provenance-marked.
  • Adversarial verifier caught and fixed real violations (leaked function names, API-contract prose in product sections) via a single rework — no review file produced.
  • ~191k tokens, no budget cap hit.

Adds a sixth role, the redattore, that runs in parallel with the final
report and restructures the original SRS into a derivative markdown
deliverable: every "[Work Item N]" section is split into two subsections
— "Requisiti di prodotto" (the what/why, caller-visible behavior) and
"Specifiche tecniche" (endpoints, schema/event identifiers, impl notes).

Properties:
- variant-agnostic and analysis-independent: reads only the original SRS
  (no findings/reviews/code/gh), so it is identical across the
  prescriptive/goals arms and never alters requirement meaning.
- content-conservative: each original sentence is redistributed into
  exactly one subsection (no duplication, no dropping, no invented facts);
  code identifiers/SQL kept verbatim; non-WI sections passed through.
- output is markdown for manual import into a NEW Confluence page
  (Insert > Markup > Markdown); the original page is never touched.
- budget-gated skip-with-flag like the other optional roles; surfaced in RR-5.

Also documents a driver-hygiene precondition in meta.whenToUse: on a
re-run of an existing slug the driver must delete derived artifacts first
(keeping repo-map/), because Write-tool roles without Bash (the redattore)
are refused on a pre-existing un-Read file and would silently keep the
stale version, and leftover prior-run files pollute the findings/*.md glob.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@paologaleotti paologaleotti changed the title feat: redattore step — split SRS into product requirements vs technical specs (srs-improved.md) feat: split SRS into product requirements vs technical specs (srs-improved.md) Jun 15, 2026
paologaleotti and others added 2 commits June 15, 2026 15:50
- restore the self-check rule: REDATTORE_SCHEMA.summary asks the agent to
  state a conservation check was done, but the prompt-simplification had
  dropped that rule — re-add it (rule 6) so schema and prompt agree and the
  content-conservation safety-net is back.
- trim the meta.whenToUse driver-hygiene note: the redattore now
  Read-before-overwrites and reads back to confirm, so it does NOT silently
  keep a stale file; the genuine remaining reason for the pre-clean is
  findings/*.md glob pollution from differently-named prior-run files
  (read by report/ricognitore). Reworded accordingly.
- document the redattore in the role-traceability doc comment (added role,
  no agents/*.md counterpart, variant-agnostic).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The redattore reads only the original SRS and now Read-before-overwrites
its own output, so it needs no driver pre-clean. The findings/*.md glob
pollution the note described concerns report/ricognitore — pre-existing
upstream roles unrelated to this feature — so it does not belong in this
PR. Restore upstream's original whenToUse verbatim.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@paologaleotti paologaleotti marked this pull request as ready for review June 15, 2026 15:04

@GorlemZ GorlemZ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (no GitHub bias — posted on request). The editor sub-pipeline and role renames look solid: clean skeleton, correct null-handling in runEditor (skipEditor / reader / verify / rework failures), and the attached srs-improved.md shows it works end-to-end. Three points below — one design (token reserve), one docs, one prompt-contract.

Verdict: NEEDS_CHANGES (none are logic bugs in the skeleton).

Comment thread workflows/spec-analyze.js
Comment thread workflows/spec-analyze.js Outdated
Comment thread README.md
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.

2 participants