Skip to content

feat: machine-readable protocol changelog (#352) - #399

Merged
preshotta merged 1 commit into
TRELLIS-STELLAR:mainfrom
okewale667:feat/352-machine-readable-protocol-changelog
Oct 23, 2026
Merged

preshotta merged 1 commit into
TRELLIS-STELLAR:mainfrom
okewale667:feat/352-machine-readable-protocol-changelog

Conversation

@okewale667

Copy link
Copy Markdown

Summary

Implements #352 — machine-readable changelog for protocol behavior.


What changed

src/changelog/protocol-changelog.service.ts

Added reload() with a rollback guarantee: if the incoming file fails validation the previous in-memory document is preserved and the error is re-thrown. A bad hot-swap cannot erase a working changelog.

src/changelog/protocol-changelog.service.spec.ts

Retry / reload path (4 new tests)

  • Successful reload replaces the cache.
  • Rollback on invalid file — previous document preserved.
  • Rollback on missing file — previous document preserved.
  • Recovery after a failed initial load once the path is corrected.

Authorization path (4 new tests)

  • @Public() metadata is present on the controller class.
  • StrategyAuthGuard grants access without a token.
  • Empty query params returns 200 with no auth header.
  • Impact filter works unauthenticated.

changelog/protocol-changes.json

docs/protocol-changelog.md (new)

Full operational runbook covering:

  • Normal, failure, retry/reload, and authorization paths
  • All 15 semantic validator rules with trigger conditions
  • Edge cases: bad deploy, clock skew, CHANGELOG_PATH override, rollback procedure, contract preservation
  • How to run the tests locally

Acceptance criteria

Criterion Status
Normal path covered existing tests + service
Failure path covered existing tests + 2 new rollback tests
Retry path covered 4 new reload() tests
Authorization path covered 4 new auth-path tests
Automated / executable verification Jest specs + npm run changelog:validate
Operational edge cases documented docs/protocol-changelog.md
Recovery / rollback documented reload() rollback guarantee + runbook
Existing contracts preserved no schema or API shape changes

How to verify locally

npm run changelog:validate         # offline schema + semantic check
npx jest src/changelog --runInBand # all unit + integration specs

Closes #352

…S-STELLAR#352)

- Add ProtocolChangelogService.reload() with rollback guarantee: if the
  new file fails validation the previous in-memory document is preserved
  and the error is re-thrown, so a bad deploy cannot erase a working
  changelog.

- Expand protocol-changelog.service.spec.ts with four retry/reload tests
  (successful reload, rollback on invalid file, rollback on missing file,
  recovery after a bad initial load) and four authorization-path tests
  (@public metadata present, guard bypass without token, empty-query 200,
  impact filter applied unauthenticated).

- Update changelog/protocol-changes.json: the machine-readable changelog
  entry now references both issue TRELLIS-STELLAR#126 and TRELLIS-STELLAR#352, and the migration notes
  document the reload() rollback guarantee.

- Add docs/protocol-changelog.md: full operational runbook covering normal
  path, failure path, retry/reload path, authorization path, all semantic
  validator rules, edge cases (bad deploy, clock skew, CHANGELOG_PATH
  override, rollback, contract preservation) and how to run the tests.

Closes TRELLIS-STELLAR#352
@preshotta
preshotta merged commit 4adbb77 into TRELLIS-STELLAR:main Oct 23, 2026
1 check passed
@preshotta

Copy link
Copy Markdown
Collaborator

Merged during the October maintenance pass after static malware-indicator review and a passing Malware guard. This is not a full security audit or a claim that the test suite passes. Please fix any remaining CI failures in a follow-up.

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.

Trellis: Create machine-readable changelog for protocol behavior

2 participants