Repository navigation
ci: enforce contributor guardrails - #5
Conversation
CONTRIBUTING.md documents the no-mistakes contribution flow and repo conventions. CI lints bin/ with shellcheck and checks repo invariants (symlinks intact, personal fleet paths untracked); a second workflow requires the no-mistakes signature on PRs targeting main.
* chore: add CONTRIBUTING guide and PR enforcement CI CONTRIBUTING.md documents the no-mistakes contribution flow and repo conventions. CI lints bin/ with shellcheck and checks repo invariants (symlinks intact, personal fleet paths untracked); a second workflow requires the no-mistakes signature on PRs targeting main. * no-mistakes(document): Sync contributor documentation * no-mistakes: apply CI fixes
…nct rc=20 for tool unavailable Extend bin/fm-decision-hold.sh with the GLM-endorsed pivot from bin/fm-holds.sh: add a list subcommand that prints the open-decision inventory with one row per captain-held decision (GLM B1), and refactor the require_tasks_axi gate to exit with rc=20 TOOL_UNAVAILABLE distinct from rc=1 decision-unverified so the unresolved-decision completion gate in bin/fm-teardown.sh:2320 no longer conflates the two failure modes (GLM B2, also pinned by §1.6 of the self-scaffolding report). list walks the per-origin state/<id>.meta decision_keys field - the same path the existing verify subcommand enumerates - so list cannot disagree with complete --none's attestation about which decisions are open. Each row carries the full AXI kunchenguid#9 context: id, origin, state (pending|routed|resolved), age, why-now episode (file:line), dependency (list of blocked-by tasks with their state, or no-block), what unlocks (exact command_resolve invocation + downstream tasks), and the hold_reason summary. --json emits the same keys as a parseable array. bin/fm-teardown.sh:2320 now distinguishes rc=20 (gate UNKNOWN: tool unavailable) from rc=1 (gate genuinely failed: decision unverified). Both still refuse teardown because the gate status is not green; only the diagnostic differs so the captain can act on the right surface (reinstall tasks-axi vs. complete the inventory). Colocated tests at tests/fm-decision-hold-list.test.sh exercise: - AXI kunchenguid#5 definitive empty state (0 results, []) - AXI kunchenguid#9 schema coverage for text and JSON output - state transitions pending -> routed -> resolved via the real resolve path - filter contract (--by-origin, --by-key; mutually-exclusive = rc=2) - distinct rc=20 for verify/complete/list with stubbed unavailable tasks-axi - fm-teardown.sh distinguishes rc=20 from rc=1 in actual teardown runs shellcheck passes; fm-lint.sh green; existing tests/fm-decision-hold-lifecycle.test.sh still passes (one pre-existing secondmate test failure is unrelated to this change). Mode=local-only per captain's standing instruction.
* feat(bin): launch crewmates inside a memory-bounded systemd scope on Linux On Linux hosts with a working systemd --user session, fm-spawn.sh now launches each crewmate's process tree through `systemd-run --user --scope --slice=firstmate-agents.slice --unit=fm-<id>-<gen>.scope` wrapping the existing launch command, so the kernel - not discipline - keeps a runaway worker's memory away from the host. Every other host keeps the prior unwrapped launch untouched, byte-identical meta included. Throttle-then-protect, not a tight cap: MemoryHigh 3G (default) lets the kernel reclaim aggressively without killing anything; only MemoryMax 6G (default) past that is fatal. firstmate-agents.slice itself gets MemoryHigh/MemoryMax at 55%/70% of MemTotal, computed from /proc/meminfo and applied with `systemctl --user set-property`, so the host always keeps roughly 30% of RAM for itself regardless of worker count. All five numbers are overridable via local gitignored config/agent-memory. - bin/fm-agent-memory-lib.sh: new library - availability detection, argv composition, meminfo percentage math, slice configuration, live MemoryCurrent/Result reads, and an idempotent OOM status-append. - bin/fm-spawn.sh: sources the library, wraps the launch when available, records memory_scope=/memory_high=/memory_max=/memory_swap_max= in meta. - bin/fm-crew-state.sh: reports the scope's live MemoryCurrent on every read, and names an OOM-kill in the dead-endpoint detail. - bin/fm-watch.sh: on first sighting of a stale, confirmed-dead endpoint, appends `failed: killed by the per-worker memory limit (MemoryMax=...)` to the task's own status log so firstmate escalates on the actual cause. - bin/fm-teardown.sh: cleans up the new state/<id>.oom-reported marker. - tests/lib.sh: globally exempts the test suite from opportunistically activating the real wrapper on a systemd host, so existing spawn fixtures that assert on literal launch text stay deterministic; the new fm-agent-memory-* tests explicitly clear the exemption to exercise it. - docs/configuration.md, AGENTS.md: document config/agent-memory and the new meta/state fields. Manually verified on this host (a Fedora host, MemTotal 15758624 kB): slice configure computed MemoryHigh=8875257036 MemoryMax=11295781683 bytes (55%/70%); a throwaway `sleep` scope launched through the real wrapper reported a live MemoryCurrent while running. Does not change the 6-worker operating cap or touch project clones. Also fixes tests/fm-backend-herdr-presentation-e2e.test.sh's normalize_meta, which now normalizes memory_scope= the same way it already normalizes spawn_gen= (both embed the same non-deterministic spawn incarnation), so the opted-out-vs-projected metadata byte comparison stays correct. Full regression sweep (bin/fm-test-run.sh --changed, ~3100 assertions) is green except 5 pre-existing failures confirmed unrelated to this change by reproducing identically on a clean pre-change worktree (8c6bbb6) or by tracing the failing code path (fm-watcher-lock.test.sh HUP timing under load, fm-backend-herdr-focus-flash-e2e.test.sh's Part C, fm-bootstrap.test.sh and fm-session-start.test.sh's MISSING-tool diagnostics, plus fm-pr-check-security.test.sh crashing on this host's missing `shasum`). * fix(tests): exempt real fm-spawn e2e guards from the memory-scope wrapper tests/fm-cmux-claude-composer-live-e2e.test.sh and tests/herdr-test-safety.sh drive the real bin/fm-spawn.sh but don't source tests/lib.sh, so its global FM_AGENT_MEMORY_DISABLE=1 exemption never reaches them. Without this, a real spawn on a systemd-capable host activates the systemd-run wrapper, changing process-tree shape and timing under families whose assertions are already timing-sensitive - same reasoning as the existing FM_GATE_REFUSE_BYPASS exemption in tests/lib.sh. * fix(bin): scrub internal hostname literal from memory-scope comments bin/fm-agent-memory-lib.sh and bin/fm-spawn.sh named a specific captain-private host in a code comment explaining why the per-worker memory throttling exists. firstmate is a shared template repo; comments describe the general condition (a busy fleet freezing a host) instead of naming which host. * no-mistakes(document): docs(scripts): list fm-agent-memory-lib.sh in bin/ inventory --------- Co-authored-by: NewAiCoder <[email protected]>
Operator notes (read before deploying)
|
fix(bin): record non-ASCII Lavish board answers intact instead of cutting them off
…t-windows-abspath fix(bin): treat a native Windows absolute CLAUDE_CONFIG_DIR as absolute
Zusammenfassung (Backend-Strang, Runde 1 und 2)Refactor von Vertragsänderung (freigegeben): Eine syntaktisch ungültige ID verhält sich wie eine unbekannte. Bewusst nicht übernommen (Prüfbericht Schicht 3):
Von der Pipeline ergänzt: Tests prüfen Parameter statt SQL-Text; |
* feat: ship the daily intake and to-do page as an opt-in feature Bring the morning intake gate, the continuous channel intake and the daily to-do page engine into Starship as one optional system. Nothing reads, arms or schedules until a home's config/morning-intake or config/channel-intake turns it on, and each home names its own sources. The page engine keeps no system-specific code. An add-on extends it through two new hook points: todo-verbs takes more verbs typed on a row and marks the row with fm-todo.sh mark, and todo-page adds sections of its own. A home whose add-on carries same-named tools, hooks or skills keeps running the add-on's. * no-mistakes(review): Add hand-over, reopen guard and ledger partner-awaiting; behavioural tests * no-mistakes(review): Let source resolution beat hand-over reopen; harden isolation test * no-mistakes(review): Reopen only when the source did not change state * no-mistakes(ci): Fixed "Behavior portable parallel 2": tests/fm-test-run.test.sh "packing exactly at the budget must be accepted" failed (exit 1). Rule broken: the portable serial lane must keep enough spare room that a script weighted exactly at the 1200000 ms budget packs alone, and the shard count must agree everywhere it is set. This PR added four serial test scripts (fm-channel-intake, fm-morning-intake, fm-todo, fm-todo-render) with no measured time, each counted at the 45000 ms default. The largest serial shard rose from 1180219 to 1194905 ms and the boundary fixture overflowed to 1205215 ms; reproduced locally. Fix: (1) added the four scripts' measured duration_ms from this PR's CI run 41103972215 to portable_serial_weight_hints (64209, 18194, 53145, 24241 ms); measured times alone still overflowed by 3404 ms. (2) Following precedent commit 12d6173 (11 to 12 shards for the same failure), went from 12 to 13 serial shards in bin/fm-test-run.sh, .github/workflows/ci.yml, .github/workflows/windows-wsl.yml (lanes of13 plus 13of13), tests/fm-install-herdr.test.sh, CONTRIBUTING.md and docs/fm-test-portable-shards.md, which also records where the new times came from. Verified: --check-coverage passes (serial_shards=13, serial_max_ms=1101850); tests/fm-test-run.test.sh, fm-install-herdr, fm-ci-workflow and fm-linux-setup all exit 0. Follow-up for the owner: add "Behavior portable serial 13" to the required checks in branch settings. Note: a temporary git worktree was briefly created outside this worktree to check the base commit, then removed and pruned right away
… config/herdr-workspace' (kunchenguid#5) from fm/herdr-home-space into main Reviewed-on: https://git.ghazni.xyz/ghazni/firstmate-dsh/pulls/5
Intent
The captain wants firstmate to have the same contributor guardrails as his other repos (lavish-axi, gh-axi, trial-by-combat, etc.): a CONTRIBUTING.md guide plus GitHub Actions enforcement for PRs. Adapted from the standard set: (1) CONTRIBUTING.md documenting the mandatory git-push-no-mistakes flow and firstmate-specific repo conventions (template repo, AGENTS.md is the contract, CLAUDE.md/.claude/skills symlinks, tracked-vs-local split, bash + shellcheck, one sentence per line in Markdown); (2) no-mistakes-required.yml copied from lavish-axi minus the release-please bot exemption since this repo has no releases; (3) ci.yml that shellchecks bin/*.sh and checks repo invariants (symlinks intact, personal fleet paths like data/ state/ config/ projects/ untracked). guard-generated-files.yml was deliberately NOT ported because firstmate has no release-please or generated files. The SC2016 shellcheck directive added in bin/fm-spawn.sh is deliberate: the single-quoted launch templates defer expansion to the crewmate tmux pane, and the directive makes shellcheck pass clean so CI can enforce it. All CI steps were verified to pass locally before commit.
What Changed
CONTRIBUTING.mdguide covering the required no-mistakes workflow and firstmate repository conventions.Risk Assessment
Testing
Bootstrap was clean; I exercised the PR enforcement script end-to-end for signed and unsigned human PR bodies, exercised the CI repo invariant checks, confirmed the omitted generated-file guard and lack of release-please exemption, and left the worktree clean. I did not run the shellcheck CI step because this testing prompt explicitly forbids linters/static analysis.
Evidence: PR signature enforcement transcript
Scenario: human PR created by no-mistakes with signature Found no-mistakes signature in PR #42 body. Result: accepted Scenario: human PR without no-mistakes signature ::error::This PR was not raised through no-mistakes. Contributions to this repository must be submitted via 'git push no-mistakes'. That pipeline runs the required review/test/lint/CI steps and writes a deterministic '## Pipeline' section into the PR body containing: Updates from git push no-mistakes See CONTRIBUTING.md for setup and the full workflow. PR author: octocat Result: rejectedEvidence: Repo invariant transcript
Scenario: CI symlink invariants CLAUDE.md -> AGENTS.md .claude/skills -> ../.agents/skills Scenario: CI personal fleet path invariant No tracked files under data/, state/, config/, projects/, or .no-mistakes/. Scenario: generated-file guard deliberately absent No .github/workflows/guard-generated-files.yml tracked.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
.github/workflows/no-mistakes-required.yml:31- The required check accepts any PR body containing this public marker, so a manually opened PR can paste the string and pass without ever going through no-mistakes. If this is meant to enforce the gate rather than serve as an advisory convention, validate a non-forgeable signal from the no-mistakes run or document the limitation explicitly..github/workflows/ci.yml:18- I did not runshellcheck bin/*.sh, so I could not directly demonstrate the new CI lint job passes. This validation prompt explicitly forbids linters/static analysis, and shellcheck is a linter.bin/fm-bootstrap.shSimulated.github/workflows/no-mistakes-required.ymlPR-body check with a no-mistakes-signed human PR body and a manual human PR body, recording/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KTX6NK7HKCCY4H1Y4NF0X775/no-mistakes-required-transcript.txtExecuted.github/workflows/ci.ymlrepo invariant commands forCLAUDE.md,.claude/skills, and personal fleet paths, plus verifiedguard-generated-files.ymlis not tracked, recording/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KTX6NK7HKCCY4H1Y4NF0X775/repo-invariants-transcript.txtSearched workflows forrelease-please,github-actions[bot],dependabot[bot], andguard-generated-filesto confirm only the intended bot exemptions are present and the generated-file guard was not portedSearchedbin/*.shfor the deliberateSC2016directive documenting deferred crewmate-pane expansiongit status --short✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.