Skip to content

Commit 890bd37

Browse files
author
Sungin Kim
committed
no-mistakes(document): Document endpoint-binding migration behavior
1 parent e174818 commit 890bd37

5 files changed

Lines changed: 16 additions & 14 deletions

File tree

‎.agents/skills/bootstrap-diagnostics/SKILL.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ When any diagnostic needs captain attention, report the plain consequence and re
4545
Resume the emitted supervision protocol after finishing the session-start wake handling.
4646
- Any other `PR_CHECK_MIGRATION:` refusal means migration did not complete safely, whether because watcher exclusion, a private path, a diagnostic, quarantine validation, or marker publication could not be proved.
4747
Keep each affected poll unavailable, inspect the named private state path, and do not bypass the migration or execute a quarantined artifact; a completed safe-scan marker allows unrelated authenticated polls to continue while private repair remains pending.
48-
- `ENDPOINT_BINDING_MIGRATION: task <id> (<backend>): <reason>; record left unchanged` - this task was recorded before task metadata carried its cleanup binding, and the one-shot migration could not verify that the recorded endpoint still belongs to this task, so cleanup will keep refusing it.
48+
- `ENDPOINT_BINDING_MIGRATION: task <id> (<backend>): <reason>; record left unchanged` - this non-tmux task record lacks its cleanup binding, and the one-shot migration could not verify that the recorded endpoint still belongs to this task, so cleanup will keep refusing it.
4949
This is correct and deliberate: an unproven binding would let cleanup destroy another task's endpoint, so never hand-write the binding, relax `fm_backend_validate_task_endpoint`, or force cleanup past the refusal.
50-
A `gone` reason means the endpoint no longer exists, and a label or identity mismatch means the recorded opaque id now resolves to something else.
50+
A `gone` reason means the endpoint no longer exists, and a label or identity mismatch means the recorded task identity failed verification.
5151
No work is at risk and supervision, peeking, and steering are unaffected; the task simply cannot be cleaned up.
52-
When the recorded endpoint is live again, the sweep converges it on the next locked session start with no action; otherwise treat retiring the record as a captain decision.
52+
When the recorded endpoint is live again with the expected task identity, the sweep converges it on the next locked session start with no action; otherwise treat retiring the record as a captain decision.
5353
- `SECONDMATE_SYNC: secondmate <id>: skipped: <reason>` - secondmate convergence left a live home on its existing checkout because the home was dirty, diverged, unsafe, on the wrong branch, missing its placement-specific target commit, unreachable, or otherwise not fast-forwardable, or because inherited local-material propagation failed; bootstrap continued, but inspect the reason because the secondmate's tracked instructions, inherited settings, or shared captain preferences may be stale after a primary update.
5454
- `SECONDMATE_LIVENESS: secondmate <id>: skipped: <reason>|respawn failed after <cause>: <reason>` - the session-start liveness sweep could not guarantee that the registered secondmate is running a real agent process.
5555
Investigate the reason because that secondmate is not guaranteed live.

‎bin/fm-bootstrap.sh‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@
8080
# refresh relays any completed fm-fleet-sync.sh output before the
8181
# aggregate timeout skip line with timeout and elapsed seconds.
8282
# Set FM_FLEET_PRUNE=0 to skip branch pruning during that refresh.
83-
# An ENDPOINT_BINDING_MIGRATION line reports one legacy non-tmux task
84-
# record that predates `endpoint_task_id=` and whose recorded endpoint
85-
# could not be verified to belong to that task, so cleanup still
86-
# refuses it; bin/fm-endpoint-binding-migrate.sh owns that contract.
83+
# An ENDPOINT_BINDING_MIGRATION line reports one non-tmux task record
84+
# that lacks `endpoint_task_id=` and whose recorded endpoint could not
85+
# be verified to belong to that task, so cleanup still refuses it;
86+
# bin/fm-endpoint-binding-migrate.sh owns that contract.
8787
# Set FM_BOOTSTRAP_DETECT_ONLY=1 to skip the seven MUTATING sweeps
8888
# (PR-check migration, endpoint-binding migration, secondmate_sync,
8989
# secondmate_liveness_sweep, secondmate_handoff_resume, x_mode_setup,

‎bin/fm-endpoint-binding-migrate.sh‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
# cmux endpoint id is opaque and does not encode the task it belongs to. Legacy
88
# tmux records need no migration: their window name is exactly `fm-<id>`, so the
99
# record identifies itself. A record spawned on a non-tmux backend before that
10-
# field existed instead refuses cleanup permanently.
10+
# field existed would otherwise refuse cleanup indefinitely.
1111
#
1212
# This sweep writes the missing binding ONLY for a record whose recorded
13-
# endpoint still resolves, live, to a runtime object carrying that task's own
14-
# label - the same class of self-identifying evidence the legacy tmux path
15-
# validates by window name. Every other outcome refuses and leaves the record
16-
# byte-unchanged: an opaque id whose ownership cannot be proven right now must
17-
# never gain a durable binding, because a wrongly bound record authorizes
13+
# endpoint still resolves, live, to a runtime object carrying backend-specific
14+
# evidence of that task's identity - the same class of self-identifying
15+
# evidence the legacy tmux path validates by window name. Every other outcome
16+
# refuses and leaves the record byte-unchanged: an opaque id whose ownership
17+
# cannot be proven right now must never gain a durable binding, because a
18+
# wrongly bound record authorizes
1819
# destroying another task's endpoint. An uncleanable task is a nuisance; a
1920
# wrongly bound one destroys work.
2021
#

‎docs/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ These five sentences are the single owner of the task-selector vocabulary; backe
8181
`fm-teardown.sh <id>` takes a task id directly and validates the complete metadata-only endpoint identity before any runtime dispatch or cleanup mutation.
8282
Missing, empty, duplicate, malformed, backend-inconsistent, or task-mismatched endpoint records are preserved and refused.
8383
Legacy tmux metadata remains cleanup-compatible when its exact window name is `fm-<id>`; opaque non-tmux endpoints require their recorded `endpoint_task_id=` binding.
84-
A non-tmux record written before that binding existed is converged by the locked bootstrap sweep `bin/fm-endpoint-binding-migrate.sh`, which adds the binding only for a recorded endpoint it verifies live to still carry that task's own label, and reports rather than binds every endpoint it cannot prove.
84+
The locked bootstrap sweep `bin/fm-endpoint-binding-migrate.sh` examines non-tmux records written before that binding existed, adds the binding only when the recorded endpoint's backend-specific live identity still proves it belongs to that task, and reports rather than binds every endpoint it cannot prove.
8585
`FM_HOME` determines Herdr's home label: the primary home uses `firstmate`, and a secondmate home marked by `.fm-secondmate-home` uses `2ndmate-<secondmate-id>`.
8686
[`herdr-backend.md`](herdr-backend.md#watching-and-task-containers) owns launcher-bound workspace placement, the label-only fallback, collision handling, and recovery behavior.
8787
The optional local `config/herdr-presentation-spaces` presence flag instead enables Herdr's default-off disposable single-task visual projection; [Optional presentation spaces](herdr-backend.md#optional-presentation-spaces) owns its behavior, safety limits, recovery contract, and narrow locked session-start cleanup of exact restored idle-shell children.

‎docs/scripts.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ The shared no-mistakes gate refusal for fleet lifecycle entrypoints is summarize
8989
| `fm-pr-lib.sh` | Own canonical task and PR validation plus private atomic PR-poll publication and identity-bound retirement |
9090
| `fm-pr-poll.sh` | Provide the byte-static watcher program for validated PR/MR-poll sidecars |
9191
| `fm-pr-check-migrate.sh` | Quarantine older task polls without execution and rebuild only canonical polls |
92+
| `fm-endpoint-binding-migrate.sh` | Add cleanup bindings to legacy non-tmux task records only after live identity verification |
9293
| `fm-pr-check.sh` | Record validated `pr=` and `pr_head=` values, then atomically arm a static merge poll |
9394
| `fm-pr-merge.sh` | Record PR metadata, then merge a task's canonical full GitHub URL |
9495
| `fm-promote.sh` | Promote a scout task in place to a protected ship task with an explicit delivery mode |

0 commit comments

Comments
 (0)