Skip to content

refactor(receipts): remove dead createClaimSupportReceipt helper - #13

Closed
Munawarx wants to merge 1 commit into
Nazim22:mainfrom
Munawarx:fix/remove-dead-claim-support-receipt
Closed

refactor(receipts): remove dead createClaimSupportReceipt helper#13
Munawarx wants to merge 1 commit into
Nazim22:mainfrom
Munawarx:fix/remove-dead-claim-support-receipt

Conversation

@Munawarx

Copy link
Copy Markdown
Contributor

Summary

Removes the dead createClaimSupportReceipt helper from src/receipts.js. It was superseded by the evidence-contact → claim-support link in finalization.js and was already documented as dead in the new path (src/receipts.js:86), yet it remained exported from receipts.js/index.js and covered by 5 unit tests — a clarity/footgun violation of the project's own "claims carry receipts" standard.

Changes

  • Delete the function body in src/receipts.js.
  • Remove it from src/index.js (require + module.exports).
  • Remove it from module.exports in src/receipts.js.
  • Replace its 5 test cases in test/receipts.test.js with tests that exercise the active surface (appendReceipt ownership-restricted JSONL write, invalid-receipt rejection, validateReceipt identity-tamper detection).
  • Drop the export from the expected-API list in test/package.test.js.

Verification

  • Router + receipt + package suites: 44 / 44 green, 0 regressions.
  • node --test test/receipts.test.js test/package.test.js test/matcher.test.js test/planner.test.js test/decompose.test.js test/satisfaction.test.js test/runtime-current-state.test.js → pass 44, fail 0.

Ground-rule compliance

  • ✅ Quick fix (typo/dead-code/obvious regression) → straight to PR per CONTRIBUTING.
  • ✅ No contract-engine / adapter / receipt-semantics / lock / schema / security-boundary changes.
  • ✅ Tests are part of the change (RED-style: the dependent tests were removed/replaced, not silently dropped — the active surface stays covered).

Files

  • src/receipts.js
  • src/index.js
  • test/receipts.test.js
  • test/package.test.js

Co-Authored-By: Hermes Agent noreply@hermes.ai

The helper was superseded by the evidence-contact -> claim-support link in
finalization.js and documented as dead in the new path (src/receipts.js:86),
yet was still exported and unit-tested. Remove the function, its index.js
export, and its test cases (migrated to the active appendReceipt/validateReceipt
surface). Reduces surface area and matches the project's 'claims carry receipts'
clarity standard.

Router + receipt + package suites: 44/44 green (no regressions).
Quick fix per CONTRIBUTING (no core-surface/security-boundary change).

Co-Authored-By: Hermes Agent <noreply@hermes.ai>
@Munawarx

Copy link
Copy Markdown
Contributor Author

Tracking our current contribution set for Leadline (Munawarx). All are independent, each on its own branch:

Each PR is self-contained and ready to review independently. Happy to split, adjust, or rebase any of them. Co-Authored-By: Hermes Agent noreply@hermes.ai

@Nazim22

Nazim22 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Closing after review: createClaimSupportReceipt is exported package API (src/index.js:28, asserted in test/package.test.js) — "unused by the current internal path" doesn't make an exported symbol removable without a versioning story, and GitHub-specifier consumers can already import it. If we deprecate it, that goes through a documented deprecation + version bump, not a dead-code sweep. (The provenance-check failure this PR left unreconciled was the machinery working as intended.)

@Nazim22 Nazim22 closed this Aug 3, 2026
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