feat(service): campaign routes — GET /amicode/campaigns + /amicode/campaign over the session ledgers (#658) - #662
Open
aarontrowbridge wants to merge 3 commits into
Open
feat(service): campaign routes — GET /amicode/campaigns + /amicode/campaign over the session ledgers (#658)#662aarontrowbridge wants to merge 3 commits into
aarontrowbridge wants to merge 3 commits into
Conversation
GET /amicode/campaigns and /amicode/campaign join FETCH_ROUTES so the upcoming Campaign Inspector digest widget can fetch them. Exact-match property preserved and tested: /amicode/campaign-x, /amicode/campaignx, and /amicode/campaigns-extra still fail the prefix-ride check.
…on ledgers (#658) The Campaign Inspector's data path: two read-only routes over the personal vault's sessions/ dir plus the ledger-section parser that feeds them. - campaign_ledger.ts — mechanical projection of the stable nine-section grammar: split on the '## N.' headers (the '## §N' variant and the out-of-order '## 10.' thread included), §2's verdict table parsed to rows (header kept, separator dropped), §3/§4/§5 as structured text, §8 bounded to the last 10 table rows (last 40 lines when non-table), §9 as compaction. The §9-straddle corruption (loop rows appended after §9's header, verified in the wild) is recovered: §8's table extends to EOF, no rows lost to the compaction bucket. node-builtins only, per the sibling rule; frontmatter parsed regex-lite like stack_state.ts's parseMarker. - GET /amicode/campaigns — newest-first list (slug, date, campaign, status, type, one-line objective) from the personal vault via the vault family's mount resolution. Empty/missing dir → empty list; frontmatter-less or malformed ledgers degrade to null fields + the filename date; unreadable entries (directories-as-files included) are skipped. Never a 500. - GET /amicode/campaign?slug=… — one ledger's structured sections (verdicts/active_work/blocked/next_queue/loop_log_tail/compaction/ sections_found + file_date for staleness honesty). Unknown slug → the problems.ts not_found BODY convention; the slug guard doubles as the session-*.md glob and bars traversal. The vault-browser's fail-closed loopback law rides along (personal mounts pass by default). - Fixtures: trimmed REAL ledgers — the clean strumento-twins one and the §9-straddled hrl-8dot one — plus synthetic edges (missing §4/§5, empty dir, frontmatter-less, malformed frontmatter, non-table §8). AC map: list route + parser = AC1, detail route = AC2, straddle recovery = AC3, degradation = AC4 (allowlist = separate ui commit).
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ts test (drift gate green) The overlay is extractor-managed; the campaign-route slice's two overlay edits (widget-allowlist FETCH_ROUTES + its exact-match test) needed their manifest sha256 entries re-recorded. Precedent: #639's manifest hash updates. Local drift gate: PASS (558 files).
aarontrowbridge
marked this pull request as ready for review
August 31, 2026 05:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #658
What
The Campaign Inspector's data path (slice zero-and-a-half of the approved Armonia knowledge-system design): two read-only routes over the personal vault's session ledgers, plus the widget-fetch allowlist entries so a digest widget can consume them.
GET /amicode/campaigns— everysessions/session-*.mdin the personal vault, newest first: slug, date, campaign, status, type, one-line objective. Empty/missing dir → empty list; malformed frontmatter degrades to null fields + filename date; never a 500.GET /amicode/campaign?slug=…— one ledger parsed into structured sections: verdict-table rows, active work, blocked, next queue, a bounded loop-log tail (last 10 table rows / 40 lines), compaction state, sections found, file date (staleness honesty — ≤15-min off-machine per the sync cadence). Unknown slug → the service's not_found convention; the slug guard doubles as thesession-*.mdglob and bars traversal.FETCH_ROUTES; exact-match property preserved and tested (/amicode/campaign-xdoes not ride/amicode/campaign).Acceptance criteria — evidence
session-20260820-hrl-8dot-spin-mintime) is a checked-in fixture; no rows lostDirector gates (independently run)
--force-with-lease(campaign-owned feature branch; content-equivalence diff-verified before the push)Leftovers flagged
DEMOS.mdfrozen-but-spliced — separate slice, already queuedsession-20260831-session-spawn-and-hub-resilience) — another live session on the fleet; thefile_datestaleness field exists precisely so the UI can show sync-cadence truthMerge
Awaiting human review per campaign discipline. CI runs on this PR.