Skip to content

[GRV-26]: Establish attribution catalog and repair boundary guard#44

Merged
github-actions[bot] merged 1 commit into
mainfrom
symphony/grv-26-establish-attribution-catalog-and-repair-boundar
Jun 5, 2026
Merged

[GRV-26]: Establish attribution catalog and repair boundary guard#44
github-actions[bot] merged 1 commit into
mainfrom
symphony/grv-26-establish-attribution-catalog-and-repair-boundar

Conversation

@riddim-developer-bot

Copy link
Copy Markdown
Contributor

Summary

Part of the llm-cost architecture contracts Project. Two deliverables, both scoped to the llm-cost-attribution package (per this issue's title + llm-cost-attribution label):

  1. Repair the boundary guard so its config reflects the package after the estimation extraction.
  2. Establish the attribution use-case catalog as the canonical, complete source of truth for the attribution surface.

Repair boundary guard — packages/llm-cost-attribution/scripts/check-boundary.mjs

The boundary config carried two dead references to modules that were extracted to llm-cost-estimation (in GRV-2 / the estimation split) but never removed here:

  • src/enrich.mjs in coreModules
  • src/linear-estimate-source.mjs in adapterModules

Neither file exists in this package, so existsSync silently skipped them — the guard claimed to protect/classify modules it can no longer see. Repaired by:

  • Removing both dead entries.
  • Replacing stale remediation text that still pointed at the moved LinearEstimateSource with port-neutral attribution guidance (SessionSource / IssueMatcher / UsageRecordSource / UsageRecordSink). The defensive @linear / https / fs / child_process forbidden-package rules are kept.

To repair the class of bug (not just the instance), test/boundary.test.mjs now:

  • Adds config-integrity tests asserting every configured coreModules / adapterModules path exists on disk, so dead or phantom entries fail CI instead of silently passing.
  • Exercises the core-imports-adapter rule against a real adapter (attribution-adapters.mjs) instead of the removed Linear adapter.

Establish attribution catalog — docs/architecture/use-case-catalog.md

  • Added a canonical intro, the inward dependency rule, and the linkage to the boundary guard that enforces it.
  • Cataloged the two remaining public use cases that were documented in the package catalog/README but missing here: CreateAttributionWorkflow and ListKnownIssues. The catalog now covers the full attribution public surface.

Verification

  • npm test (llm-cost-attribution): 200 pass / 0 fail (was 198; +2 new config-integrity tests).
  • node scripts/check-boundary.mjs: Boundary check passed.
  • node --check on changed scripts/check-boundary.mjs and test/boundary.test.mjs: ✓.
  • Project-acceptance, llm-cost-architecture-contracts — GRV-26's portion is fully green:
    • architecture-boundary.check.mjs (runs the repaired guard): ✓
    • attribution-ports.test.mjs: ✓
    • catalog/API alignment: no findings for llm-cost-attribution.
  • Rebased onto latest origin/main (includes [GRV-27]: Resolve estimation API and catalog drift #43 / GRV-27).

Out of scope (observed, not fixed here)

The non-required project-acceptance gate still reports one finding, in the separate llm-cost-estimation package, left by the just-merged GRV-27 (#43): packages/llm-cost-estimation/docs/use-cases.md:67 marks the now-implemented forecastProjectCost as planned/stubbed. That is estimation-catalog territory (GRV-27's rollout), not this attribution issue — flagged here as a breadcrumb for a follow-up rather than mixing packages in one PR. pr-build (the required gate) excludes the project-acceptance directory, so this does not block merge.

Repair the llm-cost-attribution architecture boundary guard so its config
reflects the package after the estimation extraction, and complete the
repo-root attribution use-case catalog as the canonical source of truth.

Boundary guard (scripts/check-boundary.mjs):
- Drop the dead `src/enrich.mjs` core entry and the phantom
  `src/linear-estimate-source.mjs` adapter entry. Both modules moved to
  llm-cost-estimation; existsSync silently skipped them, so the guard
  claimed to protect/classify modules that no longer exist here.
- Replace stale remediation text that still pointed at the moved
  LinearEstimateSource with port-neutral attribution guidance.

Regression guard (test/boundary.test.mjs):
- Add config-integrity tests asserting every configured core/adapter
  path exists, so dead or phantom entries can't silently recur.
- Exercise the core-imports-adapter rule against a real adapter
  (attribution-adapters.mjs) instead of the removed linear adapter.

Attribution catalog (docs/architecture/use-case-catalog.md):
- Add a canonical intro, the inward dependency rule, and the boundary
  guard enforcement linkage.
- Catalog the two remaining public use cases (CreateAttributionWorkflow,
  ListKnownIssues) so the catalog covers the full attribution surface.

Co-authored-by: riddim-developer-bot <developer-bot@riddimsoftware.com>
@github-actions github-actions Bot enabled auto-merge (squash) June 5, 2026 07:09
@github-actions github-actions Bot merged commit 3d0c3f4 into main Jun 5, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants