feat(bin): add mark-feed process-event adapter for page marks - #9
Merged
Merged
Conversation
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.
Intent
The captain's words (2026-09-26): "when I decide something here, currently you have no way of knowing that I did that until I tell you ... How can we improve this for session ledgers in general and any decide pages where I click anything, globally in all our page templates?" and, on the plan, "Yeah I think this is a good plan."
The page server side is shipped: a mark feed with a long-poll endpoint and a poll script that blocks until the next mark, prints one line per mark (
mark <surface> <slug> <kind> <item> <value> [session=<8 chars>]) and exits. What is missing is the firstmate side: a process-event adapter so firstmate can register that script as a source and get acheck:wake per mark.What Changed
bin/fm-procevent-markfeed.sh, a process-event adapter (arm,classify,--help). It registers the page server's poll script as a source and turns each batch ofmark <surface> <slug> <kind> <item> <value> [session=<8 chars>]lines into onecheckwake. The poll command is stored as argv and run directly, never through a shell, and mark text is treated as inert data. A clean exit with nothing printed re-arms silently. A poll failure with no marks is one terminal captured error that stops the source.tests/fm-procevent-markfeed.test.shand wired it intobin/fm-test-run.sh(test family, timing baseline, and the changed-path mapping forbin/fm-procevent-markfeed.sh).docs/configuration.md,docs/scripts.md, and theprocess-event-sourcesskill. The skill now covers arming and the wake handling formarks,idle,error, andunknownoutcomes.Risk Assessment
✅ Low: A new, self-contained adapter that mirrors the existing quota and lavish adapters' arm/poll/classify/terminal/silent seams, treats mark lines as inert data, and has behavioral tests. I found no defect or unrequired component.
Testing
Ran the adapter's behavioral test file (passes under umask 022) and drove the adapter live through the real fm-procevent.sh runner in isolated state dirs. Marks gave one check wake per batch with the lines carried intact, idle gave no wake, and a failing command gave one wake and retired the source. The hostile-mark-line and arm/retire validation cases were exercised only by the test harness, so they are recorded as untested live. The one problem is a test-environment quirk: under the 0002 umask the test's final arm/retire case errors out, exactly as the sibling quota test does.
check:wake when it prints a mark (through the real procevent runner)fm-procevent.sh start: wake queue holdscheck: procevent markfeed markfeed-live 1, pending=1marks: 2and both mark lines; a single wake entrylistafterwardsEvidence: live marks run: wake queue and captured result
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
check:wake when it prints a mark (through the real procevent runner)fm-procevent.sh start: wake queue holdscheck: procevent markfeed markfeed-live 1, pending=1marks: 2and both mark lines; a single wake entrylistafterwardsbash tests/fm-procevent-markfeed.test.shunder umask 022 (all cases pass; under the daemon's umask 0002 the final arm/retire case fails with a bad-mode private-directory error, same as the sibling quota test)Live:fm-procevent-markfeed.sh arm --name live -- <poll script>thenfm-procevent.sh start markfeed-livein an isolated FM_HOME; a poll script printing one mark line produced one durablecheck: procevent markfeed markfeed-live 1wake and 1 pendingLive: a two-mark poll produced one wake per batch, with the captured result document carrying both mark lines verbatim underoutput:Live: a poll that exits 0 with no output added no wake and left 0 pendingLive: a poll that exits 5 produced one wake and the source was retired fromlist, so it is not restartedLive:fm-procevent.sh handledcleared pending andfm-procevent-markfeed.sh retire liveremoved the source✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.