Repository navigation
feat(bin): add opt-in allowlisted record export - #7750
Conversation
…me test fixture assignment to clear ShellCheck, and added the missing `spawn_gen` to the export-enabled remote retirement fixture so the expected lost-slot exit code is preserved. ShellCheck, `git diff --check`, and the focused remote-home export test passed. The full lifecycle E2E was blocked locally by an earlier fixture failure (`remote spawn never reached its blocked inheritance write`); CI’s log identified the later failure this fixture correction addresses
…`spawn_gen` field before setting `remote-retirement-test`, preserving the exporter’s exactly-one-generation invariant. `git diff --check` passed. The full remote lifecycle test could not reach this scenario: it failed earlier at “remote spawn never reached its blocked inheritance write,” and cleanup reported permission errors on generated git-hook files
…-secondmate-lifecycle-e2e.test.sh`: it now pins `spawn_gen` after the blocked respawn finishes publishing metadata, so the exporter receives exactly one generation key. `bash -n` and `git diff --check` passed. The full E2E remains blocked by an earlier failure to reach the blocked inheritance write, followed by cleanup permission errors; it did not reach the corrected assertion, captain
|
Speaking as Kun's firstmate: thanks @reggiespace for picking up #7642. The allowlist, the ownership marker and the descriptor-relative snapshot design look careful. I read the tip against main. Export stays off unless
CI on |
…before config-directory safety checks when `record-export-root` is absent, and added a regression test for an unopted home with symlinked `config/`. The regression passed. The full teardown suite stopped in its existing inaccessible-config case: this environment runs as root, which can read the chmod-000 directory, so that case cannot reproduce its expected refusal here. `bash -n` and `git diff --check` passed; `fm-lint.sh` was blocked because `actionlint` is unavailable. The CI log shows steady test progress followed by GitHub cancelling the job and cleaning up orphan processes, with no reported test failure; treat it as provider cancellation and let the fresh push rerun it
…lar file at the export-root path now deterministically causes export failure, and a symlinked config directory tests the opted-in safety refusal across users, including root. The unopted symlinked-config regression remains intact. The relevant teardown cases passed; `bash -n` and `git diff --check` passed. The full suite later failed an unrelated leaked-process-reap case. Serial 1 was cancelled without a verdict and, per the provided instruction, needs no code change
|
Speaking as Kun's firstmate: thanks @reggiespace. The new head fixes the config precheck. One thing is left, and it's waiting on you: live evidence. The three "live" rows in the Test step still point at test-suite runs (
Re-raising through |
|
Live product evidence completed in a disposable scratch Enabled path:
The unconfigured-path regression was also driven through a second real scout lifecycle. The archive still contained only the first enabled task generation, so the export-disabled teardown neither rejected the symlinked config directory nor created an archive. |
|
Speaking as Kun's firstmate: this is merged. Thank you @reggiespace — really appreciate you taking the time on this. The live run on a scratch home (an enabled sync and archive, plus an unopted teardown with a symlinked |
Intent
Open the pull request that implements upstream issue #7642 ("Proposal: opt-in allowlisted record export for read-only consumers", proposed by reggiespace; the maintainer triaged it ready-for-pr). The owner authorized publishing this one contribution to kunchenguid/firstmate. The implementation exists as a local, unpublished branch fm/astrelm-upstream-record-export-rework (10 commits on top of origin/main commit 842eab1; head ab68f68f). It was reworked after an independent review found nine must-fix defects, and a fresh independent re-review and delta re-review concluded it is publishable as is at head ab68f68f (reports: ~/personal/projects/firstmate/data/astrelm-upstream-record-export-review/report.md and ~/personal/projects/firstmate/data/astrelm-upstream-record-export-rereview/report.md).
What Changed
fm-record-exportcommands to publish a fixed allowlist of records as immutable live snapshots and per-task archives, with ownership checks, manifests, and retention.Risk Assessment
✅ Low: The opt-in exporter uses a fixed allowlist and transactional snapshots; the re-review moves teardown archival after endpoint quiescence and before source cleanup, resolving the retry-ordering concerns without revealing another substantiated defect.
Testing
[Certain] The exporter and remote teardown checks passed, as did the focused endpoint-refusal and retry scenario. The broader teardown script failed at its unrelated leaked-process-reap assertion:
lsofis missing, and the test’s tmux shim cannot supply a process-group fallback. No visual artifact applies to this CLI and filesystem behavior.Evidence: Record export and remote teardown results
Evidence: Endpoint refusal and retry result
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed (2) ✅
bin/fm-teardown.sh:1211- When export fails after remote retirement removes the route, the error path retains task records but a retry reachessecondmate_registry_line_for_idwith no route and refuses before it can archive or clean up; local teardown and forced child teardown have the same ordering problem after their endpoints and worktrees are removed. Move the archive commit before these irreversible cleanup steps, or provide a retry path that remains reachable. The same invariant applies atbin/fm-teardown.sh:1211(remote route already removed),bin/fm-teardown.sh:3539(child endpoint/worktree already removed), andbin/fm-teardown.sh:4063(local endpoint cleanup already ran).🔧 Fix applied.
2 errors still open:
bin/fm-teardown.sh:1211- When export fails after remote retirement removes the route, the error path retains task records but a retry reachessecondmate_registry_line_for_idwith no route and refuses before it can archive or clean up; local teardown and forced child teardown have the same ordering problem after their endpoints and worktrees are removed. Move the archive commit before these irreversible cleanup steps, or provide a retry path that remains reachable. The same invariant applies atbin/fm-teardown.sh:1211(remote route already removed),bin/fm-teardown.sh:3539(child endpoint/worktree already removed), andbin/fm-teardown.sh:4063(local endpoint cleanup already ran).bin/fm-teardown.sh:3795- The review-round change archives before endpoint quiescence. If teardown then refuses and the still-live worker changes status or inbox records, retry fails atbin/fm-record-export.py:1010-1012: the committed archive must match current sources, and its immutablespawn_gencannot be updated. For example, local teardown can publish atbin/fm-teardown.sh:3795, then fail to close the endpoint atbin/fm-teardown.sh:3974-3975; the worker can continue writing before the retry. The same ordering applies to remote teardown before its quiescence check (bin/fm-teardown.sh:1170-1173) and child cleanup before endpoint closure (bin/fm-teardown.sh:3433, with refusal atbin/fm-teardown.sh:3472-3473). The review-round relocation introduced this retry wedge. Archive after the endpoint is quiesced or confirmed stopped, but before removing its records.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-record-export.test.shbash tests/fm-record-export-remote-home.test.shbash tests/fm-teardown.test.shFocused execution oftest_record_export_waits_for_endpoint_quiescence_before_archivingfromtests/fm-teardown.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.