Skip to content

fix: ground Intent Capture claims (2.5.10) - #647

Merged
apackeer merged 4 commits into
v2from
fix/issue-622-intent-grounding
Jul 24, 2026
Merged

fix: ground Intent Capture claims (2.5.10)#647
apackeer merged 4 commits into
v2from
fix/issue-622-intent-grounding

Conversation

@apackeer

@apackeer apackeer commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #622.

Intent Capture could previously add unsupported scope, stakeholder, metric, or communication claims beyond the initial description and confirmed answers. This change makes claim provenance explicit and gives deterministic, reviewer, and human checks separate responsibilities.

Changes

  • Expand Intent Capture elicitation to cover stakeholders, decision authority, communication requirements, and confirmation of the workflow-selected scope.
  • Add a ## Sources register to intent-capture-questions.md.
  • Require inline source tags and ## Assumptions & Open Questions in both produced artifacts.
  • Require explicit human acceptance or follow-up conversion for retained assumptions; accepted assumptions remain assumptions downstream.
  • Bind the Product Lead adversarial reviewer to Intent Capture and treat unresolved or unsourced factual claims as NOT-READY.
  • Add the advisory claim-sources sensor, wired through the dispatcher, unified CLI, binary build, all five harness distributions, and documentation.
  • Validate citations only from visible prose, excluding comments, code, link/image/reference metadata, HTML attributes, and hidden HTML content.
  • Make stakeholder-map a required Approval & Handoff consume.
  • Ship release metadata as 2.5.10.

The sensor validates citation shape and source resolution. It deliberately does not claim semantic entailment; the Product Lead reviewer judges whether a cited source actually supports the claim, and the human owns assumption acceptance.

Verification

  • Claim-sources sensor suite: 26 tests, 117 assertions, 0 failures.
  • Affected integrations (t43, t92, t93): 80 tests, 270 assertions, 0 failures.
  • Official smoke and unit tiers: 176 files, 4,359 assertions, 0 failures.
  • bun run check: all harness distributions in sync; all TypeScript configurations and repository-wide Biome pass.
  • git diff --check: pass.

Live Claude/Kiro TUI journeys remain opt-in and were not rerun after the rebase.

Related Work

PR #526 also edits Intent Capture for discovery-material intake. It does not implement claim-level grounding or this sensor, but it overlaps intent-capture.md and may require a conflict resolution if it lands first.

Checklist

  • I have reviewed the contributing guidance.
  • I have performed a self-review.
  • Changes are tested.
  • User-facing behavior and sensor documentation are updated.

@leandrodamascena leandrodamascena 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.

The grounding contract remains bypassable, and the PR leaves the unit tier failing.

  1. aidlc-sensor-claim-sources.ts:112-145: Source IDs and answered questions inside comments or code fences are accepted. The sensor passed artifacts citing entirely fabricated sources. Parse real Markdown entries and verify [desc], [scope], and memory references against their authoritative inputs.
  2. aidlc-product-lead-agent.md:31-34: This rule affects four other stages using this reviewer, but those stages do not produce source registers or inline citations. Scope the rule to intent-capture.
  3. aidlc-sensor-claim-sources.ts:305-308: Substring matching allows a broader assumption than the human accepted. Compare normalized assumption entries exactly.
  4. Adding the reviewer to intent-capture.md:10 breaks t232-phase-progress-flip.test.ts, which lacks the newly required review receipt.
  5. The unit tier also fails because t247-claim-sources-sensor.test.ts is absent from EXPECTED_NONE_TO_CLI, and the new sensor documentation triggers the legacy-path gate.

Validation: focused tests, packaging, typecheck, and smoke passed; unit finished with 3 failed files and 5 failed assertions.

@apackeer

Copy link
Copy Markdown
Contributor Author

Addressed the requested changes in 32c1ea8b:

  • Parse only visible Markdown source entries and answers; comments, fenced code, and inline-code citations no longer satisfy grounding.
  • Verify [desc] and [scope] against aidlc-state.md, and memory citations against the exact active-memory file, H2, and rule entry.
  • Scope the Product Lead provenance review explicitly to intent-capture.
  • Compare retained assumptions against exact normalized confirmation entries.
  • Add the missing Intent Capture review receipt in t232, register t247 in the CLI-spawner ratchet, and pin the new sensor row in the legacy-path fixture.

Validation completed:

  • Full smoke + unit tiers: 176 files, 4,337 assertions, 0 failures
  • Focused integrations (t43, t92, t93): 80 tests, 270 assertions, 0 failures
  • Package parity, coverage-registry check, typecheck, changed-file Biome, and git diff --check: pass
  • Repository-wide Biome still reports only the pre-existing aidlc-doctor-bundle.ts:628 optional-chain warning already noted in the PR description.

@leandrodamascena leandrodamascena 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.

The previous findings are fixed, but two provenance bypasses remain:

  1. Restrict memory sources to active files (core/tools/aidlc-sensor-claim-sources.ts:282)

memoryRuleMatches() accepts any file beneath the active space memory directory. Intent Capture only loads memory/{org,team,project}.md, so a fabricated file such as memory/fabricated.md can introduce an arbitrary rule that the sensor accepts as authoritative.

Please restrict accepted sources to the memory files actually loaded by this stage and add a negative test.

  1. Require an exact assumption-acceptance answer (core/tools/aidlc-sensor-claim-sources.ts:486)

The prefix regex accepts answers such as [Answer]: Accept assumptions? No as confirmation. With a matching assumption list, the sensor returns pass: true, despite the human explicitly declining acceptance.

Please parse the exact positive option, such as A. Accept assumptions, and add negative coverage for contradictory or extended answers.

The PR is also currently conflicting with v2, and its 2.5.7 version collides with the current base.

Verification: the official smoke/unit suite, packaging check, typecheck, and all 16 t247 tests pass.

@apackeer
apackeer force-pushed the fix/issue-622-intent-grounding branch from 32c1ea8 to 1152f0a Compare July 23, 2026 20:58
@apackeer apackeer changed the title fix: ground Intent Capture claims (2.5.7) fix: ground Intent Capture claims (2.5.10) Jul 23, 2026
@apackeer

Copy link
Copy Markdown
Contributor Author

Pushed the post-rebase hardening in 362fd77. In addition to both review rounds, the claim-source scanner now rejects citations hidden in Markdown link destinations, image/reference metadata, HTML attributes, hidden HTML, and HTML code, while preserving citations in visible link labels.

Final validation on v2 f32bad8:

  • bun run check: pass
  • t247: 26 tests / 117 assertions
  • affected integrations (t43, t92, t93): 80 tests / 270 assertions
  • official smoke + unit: 176 files / 4,359 assertions
  • git diff --check: pass

PR metadata is updated to 2.5.10. Ready for re-review.

@apackeer
apackeer force-pushed the fix/issue-622-intent-grounding branch from 362fd77 to d775b3c Compare July 24, 2026 11:20
@apackeer
apackeer merged commit 5cdcc63 into v2 Jul 24, 2026
5 checks passed
@apackeer
apackeer deleted the fix/issue-622-intent-grounding branch July 24, 2026 11:27
iuryeng added a commit to iuryeng/aidlc-workflows that referenced this pull request Jul 24, 2026
… t247 collision

v2's tip landed awslabs#647 (Intent Capture claim-grounding) while this branch was
rebasing, colliding on two fronts: it also claimed the 2.5.11 CHANGELOG slot,
and its new test file took t247 (which this branch had just renamed t245 to,
per the earlier apackeer-review response). Per the AGENTS.md conflict-trap
convention, this branch (second to merge) rebases and re-bumps.

- CHANGELOG heading renamed 2.5.11 -> 2.5.12, placed above awslabs#647's 2.5.11 entry.
- aidlc-version.ts / README badge bumped to 2.5.12.
- t247-source-freshness-receipts.test.ts -> t244-source-freshness-receipts.test.ts
  (t244 is the next free slot; t247 is now awslabs#647's t247-claim-sources-sensor.test.ts).
- dist/ regenerated and coverage registry regenerated to match.
iuryeng added a commit to iuryeng/aidlc-workflows that referenced this pull request Jul 30, 2026
… t247 collision

v2's tip landed awslabs#647 (Intent Capture claim-grounding) while this branch was
rebasing, colliding on two fronts: it also claimed the 2.5.11 CHANGELOG slot,
and its new test file took t247 (which this branch had just renamed t245 to,
per the earlier apackeer-review response). Per the AGENTS.md conflict-trap
convention, this branch (second to merge) rebases and re-bumps.

- CHANGELOG heading renamed 2.5.11 -> 2.5.12, placed above awslabs#647's 2.5.11 entry.
- aidlc-version.ts / README badge bumped to 2.5.12.
- t247-source-freshness-receipts.test.ts -> t244-source-freshness-receipts.test.ts
  (t244 is the next free slot; t247 is now awslabs#647's t247-claim-sources-sensor.test.ts).
- dist/ regenerated and coverage registry regenerated to match.
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