fix: PR #711 follow-ups — canonical BR IDs, runtime state-version par… - #751
Conversation
leandrodamascena
left a comment
There was a problem hiding this comment.
Siddhesh, thanks for following up on the review items from #711. I reviewed c1378b9 and verified that most of the requested changes are present:
- Functional Design and the product-agent guide now use the canonical BRx.y format.
- Domain Design traceability guidance now targets components/entities from components.md.
- The Inception reference now documents Contract Design, contract-summary.md, and the traceability outputs.
- Runtime tests were added for missing, empty, and malformed State Version values.
- Generated harness trees remain in parity.
I found the following remaining issues:
Merge blocker: the PR deletes the already-merged 2.6.1 release history
PR #711 has now merged into v2 as 2.6.1. This PR changes the existing release heading, version constant, README badge, and generated versions backward to 2.6.0.
The Changelog completeness check is correctly failing with:
this PR removes CHANGELOG entries present on the base:
-
[2.6.1]
Now that 2.6.1 exists in merged history, it cannot be retroactively renamed or removed. This follow-up is a new user-visible patch and should:
- preserve the complete existing 2.6.1 changelog entry;
- add a new 2.6.2 heading describing these follow-up fixes and upgrade guidance;
- set core/tools/aidlc-version.ts and the README badge to 2.6.2;
- regenerate all harness dist/.../aidlc-version.ts copies.
If another version lands first, use the next available patch according to the conflict-trap policy.
P2: a zero-byte state file still bypasses the runtime compatibility guard
The new validator correctly rejects a non-empty state whose State Version field is missing. However, both call sites invoke it only when the loaded content is truthy:
- core/tools/aidlc-orchestrate.ts:2633
- core/tools/aidlc-orchestrate.ts:5223
A present but zero-byte aidlc-state.md returns an empty string, so the validator is skipped entirely. next can then proceed through workflow-creation behavior instead of refusing the corrupted state.
Please distinguish state file absent from state file present but empty, invoke the compatibility check for the latter, and add next/report regressions using an actual zero-byte state file.
P2: the State Version parser consumes the next line for an empty value
The runtime and doctor regex use:
/^- State Version:\s*(\S+)/m
Because \s* includes newlines, an empty State Version value can capture the leading - from the next state bullet. I confirmed this directly: an empty version followed by - Skeleton Stance: on produces the captured version "-".
The current test passes because it accepts either generic incompatibility wording or missing, empty, or unparseable, so it does not verify which parser branch ran.
Please:
- replace cross-line whitespace with horizontal whitespace, such as [ \t]*;
- validate the captured version as a supported numeric schema token;
- assert the exact missing/empty/malformed remediation in the tests;
- add a future numeric version case and report it as incompatible rather than saying it predates v8.
P3: global stable-ID guidance still advertises the removed BR format
The stage and product-agent guide now correctly use BR1.1, but the mandatory organization guidance still lists BR-003 as a preserved stable-ID token:
- core/memory/org.md:97
Agents receive this global rule alongside the stage instructions, so the old sensor-incompatible format remains a conflicting authoritative example.
Please update the global stable-ID guidance and regenerate the harness copies.
P3: Units Generation reference still says three outputs
The corrected output table now lists four artifacts, including traceability.json, but the generation step still says:
generate the 3 output artifacts
at:
- docs/reference/04-stages/inception.md:985-986
Please update that count to four.
The functional follow-ups are largely correct, but the changelog guard is a hard merge blocker and the State Version path still has two fail-open/parser gaps. I recommend keeping this changes requested until those are addressed.
…on guard (v2.6.2) Addresses the approving-review follow-ups on the merged domain/contract restructure (#711), then leandro's round-2 review on #751: - CHANGELOG: preserve the merged `## [2.6.1]` release history and add a new `## [2.6.2]` entry for these follow-ups. Version constant, README badge, and regenerated per-harness `dist/*/.../tools/aidlc-version.ts` copies are 2.6.2. - Business-rule ID format is canonical `BRx.y` (the format the traceability sensor recognizes). Updated the stage instructions (`functional-design.md`), the product-agent functional-design guide, AND the org-level stable-ID guidance (`core/memory/org.md`) so agents no longer receive the sensor- incompatible `BR-NNN` / `BR-003` example alongside the stage prose. - Runtime state-version guard aligned with `--doctor` and hardened against three fail-open paths the reviewers found: * a PRESENT-but-zero-byte `aidlc-state.md` is now rejected (was skipped because the call sites tested `if (stateContent)` — an empty string is falsy). Both `next` and `report` call sites now check `!== null`. * the regex uses `[ \t]*` (horizontal whitespace) rather than `\s*`, so an empty version value can no longer capture the leading `-` of the next state bullet and be mislabeled as the bogus token "-". * the captured version is validated as a bare integer; a non-numeric value is reported through the unparseable branch, and a FUTURE numeric version (e.g. v9) is reported as newer than this build's v8, not as predating it. Doctor's parallel `\s*` regex received the same `[ \t]*` fix. - Domain Design traceability targets are constrained to components/entities in `components.md` (its source of truth); example is `AuthComponent`, not `AuthService.login()`. - Inception reference documentation drift fixed: Contract Design (2.8) section added, `contract-summary.md` listed in Delivery Planning inputs, `traceability.json` listed in Domain Design and Units Generation outputs, Units Generation output count corrected from 3 to 4 in BOTH the Outputs table AND its generation-step prose. Regressions added in t282: exact-remediation assertions (asserting the unparseable branch rather than either branch), a zero-byte state file case for both `next` and `report`, and a future-version (v9) case that asserts the "newer than the current" message rather than "predates".
c1378b9 to
7635251
Compare
|
Thanks @leandrodamascena — all five items addressed on 1. Changelog completeness — merge blocker resolvedThe 2.6.1 entry is now preserved byte-identical to 2. Zero-byte state file bypassBoth call sites ( 3. State Version regex + numeric validation + future-version branch
4.
|
leandrodamascena
left a comment
There was a problem hiding this comment.
Siddhesh, thanks for the thorough follow-up. I re-reviewed 7635251 and verified that the previous blockers are resolved:
- the merged 2.6.1 history is preserved and the follow-up correctly ships as 2.6.2;
- zero-byte state files are now rejected by both next and report;
- State Version parsing no longer crosses line boundaries;
- malformed and future numeric versions are distinguished at runtime;
- the global BR guidance now uses the canonical BRx.y format;
- Units Generation and Inception reference documentation are aligned;
- all generated harness trees are in parity;
- CI, changelog completeness, smoke, and unit checks are green.
I found only the following non-blocking follow-ups:
P2: State Version parsing does not reject trailing content
State Version: 8 garbage is accepted as v8 because the parser captures only the first non-whitespace token and does not require the rest of the line to be empty:
- core/tools/aidlc-orchestrate.ts:587
I confirmed the parser captures 8. Please anchor the field value to the end of the line and add a malformed trailing-content regression.
P2: Doctor does not fully match runtime version classification
Runtime correctly distinguishes malformed and future numeric versions. Doctor still routes both through its generic non-current branch:
- core/tools/aidlc-utility.ts:2058-2069
A malformed value receives stale-version wording, and a future version receives archive/reinitialize guidance instead of upgrade guidance. Please share the parser/classification logic or add equivalent doctor branches and tests.
P3: Units Generation stage prose still says three outputs
The authored stage still says:
generate 3 artifacts
at:
- core/aidlc-common/stages/inception/units-generation.md:95-97
The stage produces four artifacts, including traceability.json. The reference documentation is corrected; this remaining authored count should also be updated.
These are edge-case and documentation follow-ups, not merge blockers. The requested fixes are substantially complete and the branch is healthy.
Approving.
…on guard (v2.6.2) Addresses the follow-up review items from the merged domain/contract restructure (#711), then leandro's rounds 2 and 3 review on #751. This is a correctness/consistency patch on top of 2.6.1; no artifact or stage-graph changes. - CHANGELOG: preserve the merged `## [2.6.1]` release history and add a new `## [2.6.2]` entry for these follow-ups. Version constant, README badge, and regenerated per-harness `dist/*/.../tools/aidlc-version.ts` copies are 2.6.2. - Business-rule ID format is canonical `BRx.y` (the format the traceability sensor recognizes). Updated the stage instructions (`functional-design.md`), the product-agent functional-design guide, AND the org-level stable-ID guidance (`core/memory/org.md`) so agents no longer receive the sensor- incompatible `BR-NNN` / `BR-003` example alongside the stage prose. - Runtime state-version guard and doctor now share ONE classifier (`classifyStateVersion` in `aidlc-lib.ts`), so they can no longer disagree on whether a state is unparseable / past / future / ok: * a PRESENT-but-zero-byte `aidlc-state.md` is rejected (was skipped because the call sites tested `if (stateContent)` — an empty string is falsy). Both `next` and `report` now check `!== null`. * the parser uses `[ \t]*` (horizontal whitespace) rather than `\s*`, so an empty version value can no longer capture the leading `-` of the next state bullet and be mislabeled as the bogus token "-". * the value line is anchored to end-of-line, so trailing content such as `State Version: 8 garbage` is routed through the unparseable branch rather than accepted as v8. * the captured version is validated as a bare integer; a non-numeric value is reported through the unparseable branch, and a FUTURE numeric version (e.g. v9) is reported as newer than this build's v8 with upgrade guidance (not archive-and-reinit). Doctor now emits per-branch failing rows (`state version readable` / `state version current` / `state version compatible`) mirroring the runtime classification. - Domain Design traceability targets are constrained to components/entities in `components.md` (its source of truth); example is `AuthComponent`, not `AuthService.login()`. - Inception reference documentation drift fixed: Contract Design (2.8) section added, `contract-summary.md` listed in Delivery Planning inputs, `traceability.json` listed in Domain Design and Units Generation outputs, Units Generation output count corrected from 3 to 4 in the reference doc AND in the authored stage prose (`units-generation.md` Step 6). Regressions added in t282: exact-remediation assertions (asserting the unparseable branch rather than either branch), zero-byte state file cases for both `next` and `report`, a future-version (v9) case that asserts the "newer than the current" message, trailing-content cases for both `next` and `report`, and matching doctor cases (malformed → readable-row, future → compatible-row, trailing → readable-row).
7635251 to
d8786a6
Compare
|
Thanks @leandrodamascena — all three follow-ups addressed on 1. State Version parsing rejects trailing contentThe shared parser now anchors the value line: 2. Doctor matches runtime classification (via a shared classifier)Extracted
New t282 doctor cases pin each branch: 3. Units Generation authored prose says "4 artifacts"
Verification
|
apackeer
left a comment
There was a problem hiding this comment.
Independent second review, round 2, of d8786a67 against origin/v2 (74a51a1). I reviewed the previous head c1378b9 and re-verified every follow-up on this head line by line.
Round-1 blockers and P2s: all resolved.
- Release history restored:
## [2.6.1]is preserved and the follow-up ships as## [2.6.2], with user-facing bullets covering both the BR format canonicalization and the hardened runtime guard. Version constant and README badge agree (t68 and the CI changelog guard are green). - Zero-byte state fail-open closed: both call sites now check
!== nullrather than truthiness, withnextandreportregressions using an actual zero-byte file. - State Version parsing: the shared
classifyStateVersion()inaidlc-lib.tsis a better shape than the point fixes requested. The anchored[ \t]*(\S+)[ \t]*$parse (no newline crossing, no trailing content) plus^\d+$validation yields distinct ok/unparseable/past/future verdicts, and both runtime and doctor consume the same classifier, so parity is structural rather than copied. The future-version message correctly says "newer than the current" with upgrade guidance instead of "predates". I also probed the CRLF edge: it is safe, since JS multiline$matches before\r. - t282 now pins exact branches (including
not.toMatch(/State Version - predates/)for the empty-value case, and unparseable for8 garbage/7 archived), closing the branch-masking gap from round 1. org.mdstable-ID example is nowBR1.1; both artifact counts (the reference doc and the authoredunits-generation.md) are corrected to four.
Non-blocking notes:
- The PR description is stale: it still describes the abandoned 2.6.0 renumbering and says the Stage 2.8 section was added (that section pre-existed on base). Please refresh it before merge so a squash-merge does not enshrine the wrong description.
function:classifyStateVersionis registered UNCOVERED intests/.coverage-registry.jsoneven though t282 pins its behavior end to end; a covers-line addition plus registry regen would close that. Fine as a follow-up.- Slot awareness for maintainers: open #754 also claims 2.6.2 (and #749 claims 2.6.3); second-to-merge re-bumps per the conflict-trap policy in AGENTS.md.
Approving: CI is green at exactly this head (changelog completeness, parity + typecheck + lint, smoke + unit), and the dist trees verify as regenerated, not hand-edited.
…on guard (v2.6.2) Addresses the follow-up review items from the merged domain/contract restructure (#711), then leandro's rounds 2 and 3 review on #751. This is a correctness/consistency patch on top of 2.6.1; no artifact or stage-graph changes. - CHANGELOG: preserve the merged `## [2.6.1]` release history and add a new `## [2.6.2]` entry for these follow-ups. Version constant, README badge, and regenerated per-harness `dist/*/.../tools/aidlc-version.ts` copies are 2.6.2. - Business-rule ID format is canonical `BRx.y` (the format the traceability sensor recognizes). Updated the stage instructions (`functional-design.md`), the product-agent functional-design guide, AND the org-level stable-ID guidance (`core/memory/org.md`) so agents no longer receive the sensor- incompatible `BR-NNN` / `BR-003` example alongside the stage prose. - Runtime state-version guard and doctor now share ONE classifier (`classifyStateVersion` in `aidlc-lib.ts`), so they can no longer disagree on whether a state is unparseable / past / future / ok: * a PRESENT-but-zero-byte `aidlc-state.md` is rejected (was skipped because the call sites tested `if (stateContent)` — an empty string is falsy). Both `next` and `report` now check `!== null`. * the parser uses `[ \t]*` (horizontal whitespace) rather than `\s*`, so an empty version value can no longer capture the leading `-` of the next state bullet and be mislabeled as the bogus token "-". * the value line is anchored to end-of-line, so trailing content such as `State Version: 8 garbage` is routed through the unparseable branch rather than accepted as v8. * the captured version is validated as a bare integer; a non-numeric value is reported through the unparseable branch, and a FUTURE numeric version (e.g. v9) is reported as newer than this build's v8 with upgrade guidance (not archive-and-reinit). Doctor now emits per-branch failing rows (`state version readable` / `state version current` / `state version compatible`) mirroring the runtime classification. - Domain Design traceability targets are constrained to components/entities in `components.md` (its source of truth); example is `AuthComponent`, not `AuthService.login()`. - Inception reference documentation drift fixed: Contract Design (2.8) section added, `contract-summary.md` listed in Delivery Planning inputs, `traceability.json` listed in Domain Design and Units Generation outputs, Units Generation output count corrected from 3 to 4 in the reference doc AND in the authored stage prose (`units-generation.md` Step 6). Regressions added in t282: exact-remediation assertions (asserting the unparseable branch rather than either branch), zero-byte state file cases for both `next` and `report`, a future-version (v9) case that asserts the "newer than the current" message, trailing-content cases for both `next` and `report`, and matching doctor cases (malformed → readable-row, future → compatible-row, trailing → readable-row).
d8786a6 to
19f074c
Compare
|
Coverage fix landed on
Version-slot: leaving this at 2.6.2. Per the conflict-trap policy in PR description updated too. |
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # CHANGELOG.md
…sh authored skill tables - Rebased onto origin/v2 @ 4569754 (v2.6.2, #751). Our CHANGELOG entry re-slots to 2.6.7 (2.6.3-2.6.6 are claimed by open PRs); aidlc-version.ts and the README badge follow. - Refresh the packager-generated stage/scope table regions in the seven AUTHORED harness SKILL.md files so source readers see the current scope set (classic/express, no workshop); shipped dist copies were already correct because the packager re-renders those regions at build time. - Regenerate the coverage registry after the rebase.
PR #711 follow-ups (2.6.2)
Follow-up fixes to the merged 2.6.1 design-output restructure (#711). This PR ships as 2.6.2 — the merged
## [2.6.1]release history is preserved byte-identical, and a new## [2.6.2]entry is added on top. No stage-graph or artifact-name changes; this is a correctness/consistency patch.Addresses leandro's three review rounds on #751 (findings converged across rounds; the list below reflects what actually ships in
d8786a67).Canonical business-rule ID format
Business rules use
BRx.yend-to-end (the format the traceability sensor's regex recognizes). Removed the sensor-incompatibleBR-NNNauthoring instruction from Functional Design and the product-agent functional-design guide, and replaced the org-level stable-ID exampleBR-003withBR1.1incore/memory/org.mdso agents no longer receive a conflicting authoritative example alongside the stage prose.Runtime state-version guard + doctor unified through a shared classifier
Extracted
classifyStateVersion()intocore/tools/aidlc-lib.tsas the single source of truth. Bothaidlc-orchestrate.ts(runtimenext/report) andaidlc-utility.ts(doctor) call it, so they can't drift on how a state file is classified. The classifier returnsok | unparseable | past | future, and each caller renders the branch-appropriate message.Hardened against every fail-open path the reviews flagged across rounds:
aidlc-state.mdis rejected. Both call sites now test!== nullinstead of truthiness (an empty string is falsy and previously slipped through).[ \t]*(horizontal whitespace only) instead of\s*, so an empty value can no longer capture the leading-of the next state bullet as the bogus token-.State Version: 8 garbagefalls into the unparseable branch rather than being accepted as v8.7 archivedlikewise routes as unparseable, not past-version.mv aidlc aidlc.v{v}-archivetemplate is deliberately absent from the future branch.state version readable(unparseable),state version current(past),state version compatible(future), and the passingState Version: 8row.Domain Design traceability vocabulary
Constrained to components/entities defined in
components.md(the stage's source of truth). Example is nowAuthComponentrather thanAuthService.login(), with a note that method- and API-level targets are pinned later in Contract Design and Functional Design.Documentation alignment
docs/reference/04-stages/inception.md) and the authored stage prose (core/aidlc-common/stages/inception/units-generation.mdStep 6), so it matches the four artifacts declared inoutputs:(includingtraceability.json).traceability.jsonin the reference doc.traceability.jsonin the reference doc.contract-summary.mdin the reference doc.docs/reference/04-stages/inception.md"Key Outputs" summary numbering fixed after inserting Contract Summary.(Note:
## Stage 2.8: Contract Designwas authored in #711 and merged ontov2— this PR does not add it.)Verification
bun scripts/package.ts --checkclean across all seven harnessesbun tests/gen-coverage-registry.ts --checkcleantests/unit/t282-state-version-doctor.test.ts: 17 pass / 0 fail (covers all four classifier branches for both runtime and doctor, plus zero-byte and trailing-content regressions)t248-codekb-scope-diff, a known git-fingerprint environmental failure on cleanv2dist/trees (lib + orchestrate + utility)v2