Skip to content

feat: add private Workstack Compass snapshot producer - #1

Merged
Charliekirk-creator merged 27 commits into
mainfrom
fm/workstack-compass-live-source-snapshot-adapter
Sep 2, 2026
Merged

Charliekirk-creator merged 27 commits into
mainfrom
fm/workstack-compass-live-source-snapshot-adapter

Conversation

@Charliekirk-creator

@Charliekirk-creator Charliekirk-creator commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Intent

Build and ship a Firstmate-owned, local-only producer for authoritative workstack-compass.snapshot.v1 snapshots from live local evidence, without modifying the private Workstack Compass repository. Read only the active FM_HOME plus explicitly bound read-only project roots; use exact Firstmate registry, bounded tasks-axi backlog, task-generation, Data Team Management board, and Data Team Tickets identities without path, title, or heuristic joins. Preserve unavailable and partial evidence honestly: never invent plans, stages, work units, commands, lifecycle relations, next actions, decisions, worker liveness, context, or duration. Validate every complete candidate through the private Workstack executable model without copying its schema, publish atomically to an owner-private mode-0600 file, and refuse malformed, oversized, unsafe, or source-raced inputs without replacing the prior snapshot. Never copy live rows, source prose, status prose, environment values, private paths, credentials, source snapshots, or secrets into Git or generated snapshot contents. Include behavioral regression coverage and public operator and architecture documentation. On success report the private snapshot path and exact local launch command, but do not display snapshot contents, modify source repositories, launch Workstack Compass, merge, or publish.

What Changed

  • Add a local-only producer that projects exact-identity Firstmate and explicitly bound project evidence into Workstack Compass snapshots validated by its executable model.
  • Publish snapshots through a bounded, sandboxed, race-resistant atomic replacement with private mode 0600, while refusing unsafe, malformed, oversized, or incomplete inputs.
  • Add operator and architecture documentation, comprehensive behavioral coverage, and state-directory-anchored custom-check removal.

Risk Assessment

✅ Low: The local-only producer is well-contained, fail-closed, and backed by behavioral coverage, with no new material source risks identified.

Testing

After an initial 300-second harness timeout, the focused snapshot suite completed with a longer bound against the approved private executable model; ancillary unregister and test-selection behavior also passed. Manual CLI evidence shows atomic mode-0600 publication, the launch command, private-model acceptance, and unchanged read-only repositories without displaying snapshot contents or retaining private paths.

Evidence: Sanitized end-to-end operator transcript using the approved private executable model

Source: Sanitized end-to-end operator transcript using the approved private executable model

$ FM_HOME=<TEST_FM_HOME> fm-workstack-compass-snapshot.py --workstack-root <APPROVED_WORKSTACK_ROOT> --project-root <EXACT_NAME=READ_ONLY_ROOT> ...
Snapshot: <TEST_FM_HOME>/data/workstack-compass/snapshot.json
Launch: cd <APPROVED_WORKSTACK_ROOT> && ./bin/workstack-compass --snapshot <TEST_FM_HOME>/data/workstack-compass/snapshot.json --color --reduced-motion
$ stat -f %Lp <TEST_FM_HOME>/data/workstack-compass/snapshot.json
600
$ private Workstack JsonFileSnapshotProvider.load()
accepted; integrity issues: none
$ compare source-repository and approved-model repository state before/after
unchanged
Evidence: Focused snapshot behavioral and private-model integration test transcript

Source: Focused snapshot behavioral and private-model integration test transcript

ok - sanitized local sources produce a validated, private, truthful snapshot
ok - the shipped adapter supports the existing validator-only model interface
ok - missing exact relations remain explicitly absent
ok - duplicate and broken source identities refuse without partial replacement
ok - the whole heterogeneous state inventory is bounded before metadata filtering
ok - complete snapshots replace atomically and model rejection preserves the prior file
ok - path escapes, symlinks, and unsafe output files are refused
ok - a nonexecutable Workstack launcher is refused before publication
ok - executable model has no network, write, environment, or mutation authority
ok - model and backlog reader memory exhaustion fail within a shared bound
ok - output authority relocation refuses without modifying a source repository
ok - default output parent creation cannot follow data into a source
ok - sandboxed publication cannot follow a relocated authority into a source
ok - canonical repository containment is refused before output writes
ok - special source files are refused without blocking or replacement
ok - malformed and oversized source or output data are bounded safely
ok - empty backlogs and literal none identities follow tasks-axi contracts
ok - in-flight generation gaps remain partial evidence
ok - reader authorities participate in pre-write repository containment
ok - runtime dependency races preserve the prior snapshot
ok - retained runtime dependencies share the aggregate reader size bound
ok - runtime growth refuses before reader materialization
ok - backlog reader is confined to stdin and its executable runtime
ok - reader package races preserve the prior snapshot
ok - captured reader authorities and absolute shebang runtimes are exact
ok - an optional source appearing mid-observation prevents publication
ok - the final pre-commit proof preserves the prior raced snapshot
ok - private Workstack executable model validates the sanitized generated snapshot
Private Workstack repository HEAD and complete worktree-status digest remained unchanged.
Evidence: Focused custom-check unregister race regression transcript

Source: Focused custom-check unregister race regression transcript

ok - empty id or missing state dir refuses loudly and never rms a stray path
ok - happy path removes only the named check.sh and check-trust
ok - hard-linked or symlinked artifacts are refused and left in place
ok - state directory replacement cannot redirect custom check removal
- Outcome: 🔧 1 issue found → auto-fixed ✅ across 2 runs (31m11s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed (7) ✅
  • 🚨 bin/fm-workstack-compass-snapshot.py:1769 - IDENTITY_RE accepts leading-dot IDs such as .hidden and .., although Firstmate's canonical fm_pr_task_id_valid rejects them. Consequently, .hidden.meta with a valid spawn_gen is published as an exact Firstmate worker identity. This contradicts the required “exact Firstmate ... identities” and “refuse malformed ... inputs” criteria. Apply a task-specific validator matching Firstmate’s canonical task-ID contract at both backlog and metadata ingestion boundaries.
  • 🚨 bin/fm-workstack-compass-snapshot.py:1818 - Every successfully projected worker increments omitted, so a source containing only valid, fully included metadata records still emits the claim that “records without exact incarnation identity are omitted.” This contradicts the requirement to “Preserve unavailable and partial evidence honestly.” Count only actually skipped records, and represent unavailable current-state evidence separately when determining completeness and provenance text.

🔧 Fix: Validate task identities and correct omission provenance
2 errors still open:

  • 🚨 bin/fm-workstack-compass-snapshot.py:1820 - The required criterion “Preserve unavailable and partial evidence honestly” is contradicted by returning bool(names) as meta_present. When the required state/ inventory is successfully observed but contains zero metadata files, this reports metadata as unavailable and labels an otherwise complete empty backlog/metadata observation as partial. Track inventory availability independently of record count so an observed empty inventory remains available evidence.
  • 🚨 bin/fm-workstack-compass-snapshot.py:1323 - The required behavior to “refuse malformed, oversized, unsafe ... inputs” is not enforced for the reader's retained dynamic libraries: every dependency asset has executable=False, so its size contributes zero to staging_size. Multiple dependencies may each pass the 256 MiB individual check while their aggregate reaches tens of gigabytes. Apply the aggregate cap to unique retained dependency descriptors as well as copied payloads and runtime executables.

🔧 Fix: Bound reader assets and preserve empty inventory completeness
2 errors still open:

  • 🚨 bin/fm-workstack-compass-snapshot.py:1823 - The required “Preserve unavailable and partial evidence honestly” behavior is violated when the backlog contains an in_flight task but state/ has no matching metadata. Firstmate’s lifecycle invariant states that an in-flight row implies &lt;id&gt;.meta; however, this returns metadata as present, zero omissions, and no unavailable current state, causing build_document to report the task source as complete. Track exact in-flight backlog identities lacking generation metadata as partial/omitted evidence while still treating a genuinely empty backlog and empty observed inventory as complete.
  • 🚨 bin/fm-workstack-compass-snapshot.py:1557 - The required behavior to “refuse malformed, oversized, unsafe, or source-raced inputs” is not durably bounded: retained descriptor sizes are checked at line 1327, but reader_stage_payload later re-reads their mutable sizes without reapplying the aggregate cap. A non-system runtime can grow after validation, causing the staging subprocess to copy well beyond 256 MiB before the eventual race refusal. Capture each retained asset’s validated size at the retention boundary, use only that immutable size in the manifest, and verify descriptor fingerprints around materialization.

🔧 Fix: Preserve generation gaps and freeze reader asset sizes
1 error still open:

  • 🚨 bin/fm-workstack-compass-snapshot.py:2337 - The required criterion says to validate candidates through the private executable model “without copying its schema,” but build_document locally hardcodes the complete snapshot shape (sources, interfaces, projects, plans, etc.) and only submits it for post-hoc validation. Move candidate construction to a model-owned executable boundary that accepts sanitized evidence, or ask the user to explicitly authorize this duplicated v1 mapping if no such interface exists.

🔧 Fix: Delegate snapshot construction to executable model
1 error still open:

  • 🚨 bin/fm-workstack-compass-snapshot.py:1935 - The required goal is to “Build and ship” the producer while validating through the private executable model “without modifying the private Workstack Compass repository.” This hunk now unconditionally requires a new snapshot_from_evidence API, but the change only adds that API to the fake test model; the real-model integration remains optional and skipped by default. A validator-only private model reaches projector is None and always fails as an unsupported contract, leaving no usable shipped producer. Confirm that this versioned adapter already exists in the private model, or ask the user to authorize a compatible boundary that can be shipped here.

🔧 Fix: Support existing Workstack validator with mandatory integration proof
2 errors still open:

  • 🚨 bin/fm-workstack-compass-snapshot.py:2424 - The required criterion says to validate through the private executable model “without copying its schema,” but project_document again hardcodes the complete v1 snapshot structure and submits it only for post-hoc validation. Use a model-owned executable projection boundary compatible with the existing interface, or obtain explicit authorization to relax this requirement.
  • 🚨 bin/fm-check-unregister.sh:48 - Artifact checks and removal use the mutable $STATE pathname. A concurrent process can rename the validated state directory and replace it with a symlink before rm, causing matching files outside the original state directory to be deleted. Anchor validation and unlinking to one retained directory authority, such as a verified working directory or descriptor-relative helper.

🔧 Fix: Anchor custom check removal to validated state directory
1 error still open:

  • 🚨 bin/fm-workstack-compass-snapshot.py:1926 - The required “refuse malformed, oversized, unsafe ... inputs” boundary is incomplete: the supplied model executes after only CPU and file-size limits are set, so a model that allocates memory during import or validation can exhaust host memory before the timeout. The captured backlog reader is likewise memory-unbounded. Apply a memory limit at the earliest shared subprocess boundary so unsafe executable inputs fail without system-wide resource pressure.

🔧 Fix: Bound subprocess memory and add exhaustion regressions
✅ Re-checked - no issues remain.

🔧 **Test** - 1 issue found → auto-fixed ✅
  • ⚠️ tests/fm-workstack-compass-snapshot.test.sh:1595 - Required private-model integration evidence could not be produced because FM_WORKSTACK_COMPASS_TEST_APP is unset. The contract-compatible executable fixture demonstrates behavior but cannot prove compatibility with the approved private Workstack executable model. Provide its absolute repository root and rerun the focused test.
  • bash tests/fm-workstack-compass-snapshot.test.sh — exercised snapshot generation, truthfulness, confinement, bounds, atomic replacement, and race refusal; halted at the mandatory private-model integration due to the unset approved-root variable.
  • bash tests/fm-check-unregister.test.sh — exercised safe custom-check removal, including state-directory replacement.
  • FM_HOME=&lt;fixture-home&gt; bin/fm-workstack-compass-snapshot.py --workstack-root &lt;fixture-app&gt; --project-root ... — manually verified operator output, mode 0600 publication, no launch, omitted inferred surfaces and sensitive fixture values, source immutability, and preservation after model rejection.
  • git status --short — confirmed testing left no worktree artifacts.

🔧 Fix: Validate snapshots against private Workstack executable model
✅ Re-checked - no issues remain.

  • Initial FM_WORKSTACK_COMPASS_TEST_APP=&#34;$APPROVED_PRIVATE_ROOT&#34; bash tests/fm-workstack-compass-snapshot.test.sh reached the safety scenarios before the 300-second harness timeout.
  • Retried FM_WORKSTACK_COMPASS_TEST_APP=&#34;$APPROVED_PRIVATE_ROOT&#34; bash tests/fm-workstack-compass-snapshot.test.sh with a sufficient 900-second timeout; the complete focused suite finished successfully.
  • bash tests/fm-check-unregister.test.sh
  • bash tests/fm-test-run.test.sh
  • bin/fm-test-run.sh --list --changed --base 0866a770234502364c268a768cb7c66cc321c629 selected tests/fm-workstack-compass-snapshot.test.sh.
  • Performed an end-to-end operator invocation using sanitized live-source fixtures and the approved private Workstack executable model; verified emitted snapshot path and launch command, mode 0600, private provider loading with no integrity issues, and unchanged source/private repository state.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

kunchenguid and others added 15 commits August 30, 2026 21:13
* fix(bin): add a safe owner for custom-check retirement

Agents were improvising rm of check files with unset STATE/ID, which wedges
headless panes. Unregister validates the id and state directory first.

Co-authored-by: Cursor <[email protected]>

* no-mistakes(review): Refuse explicitly empty custom-check state overrides

* no-mistakes(document): Document custom-check retirement safety contract

---------

Co-authored-by: Cursor <[email protected]>
@Charliekirk-creator Charliekirk-creator changed the title feat: add live Workstack Compass snapshot producer feat: add private Workstack Compass snapshot producer Sep 2, 2026
@Charliekirk-creator
Charliekirk-creator merged commit 6201cd3 into main Sep 2, 2026
11 of 13 checks passed
Charliekirk-creator pushed a commit that referenced this pull request Sep 4, 2026
…nguid#3681)

* fix(bin): recognize active pipeline fix rounds with unfetched run heads

A no-mistakes fix round advances the run head beyond the submitted head,
and the pipeline commits in its own checkout, so the task copy never
receives the new commit object. fm-crew-state's strict head rule rejected
the active row, the coarse runs-list scan skipped it and matched the
older failed row at the submitted head, and an active validation read as
failed (observed on model-routing-benchmark-hardening: active head
ac61c64b vs task copy at fb47636d).

fm_nm_runs_status_for_worktree in bin/fm-nm-run-lib.sh now owns
runs-ledger attribution: the branch's newest row alone decides, and a
newest row whose head cannot resolve locally is recognized only as a
provable pipeline-owned continuation - active (running) and anchored by
the immediately older row for the same branch having ended at exactly
this worktree's HEAD. The reader keeps the axi TOON as full detail for
that proven same-branch run. Unanchored, ancestor-anchored, and terminal
unresolvable rows stay unattributed, so branch-name coincidence and other
tasks' runs never match, and fm_nm_head_matches_worktree keeps its exact
prior semantics for teardown (verified by the full teardown suite).

Tests: reproduction regression for the unfetched active fix head (reads
working via full run-step detail), coarse-path continuation when axi
answers another branch, and negative controls for the unanchored active
row and the unresolvable terminal row with the historical fallback
preserved.

Ported onto upstream/main f4d7875, where kunchenguid#3194 independently added the
branch_sync custody exemption on the full axi-status path: both mechanisms
now coexist, each owning one surface (TOON custody on the full path, the
runs ledger on the coarse path). The port deletes the superseded coarse
scan-and-skip (nm_runs_status_for_branch) and its now caller-less helpers
(fm_nm_head_resolvable, nm_coarse_head_matches_worktree), renames the
exemption comment's "the one exemption" phrasing now that a second
complementary exemption exists, and points the stale
FM_CREW_STATE_RUNS_LIMIT comment at fm_nm_runs_status_for_worktree
(judge follow-up #1). The parent coarse-guard test's fixture is the
ledger-anchored continuation shape, so its expectation flips to the fixed
behavior (working via run-step, never the older failed row); a new
mismatched-anchor coarse negative control preserves that guard's original
no-anchor protection (pane answers, never the older row).

* no-mistakes(document): Clarify pipeline attribution documentation
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