fix(bin): make bounded wake context opt-in and replay-safe - #2801
Conversation
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains in the previously reported wake-context transaction and deadline paths. No blocking failure remains. Reviews (11): Last reviewed commit: "no-mistakes: apply CI fixes" | Re-trigger Greptile |
|
Speaking as Kun's firstmate: VISION: aligns. Token efficiency is first-class: actionable wakes currently spend frontier turns reconstructing crew state. Scripts own that mechanics; Class: corrective. Fixes #1692 on the existing always-on wake path. Not a new default product behavior. Security: none. Local Overlap: CI: HEAD Workflows approved: yes (CI 32595118059, NM 32595117981). Land-eligible: NO. Waiting on CI; even a green CI still needs a matching NM attestation from the author. Not waiting on the captain. Captain-flag NOW: no. |
|
The updated head f96caaa contains the reviewed and tested bounded wake-context fix. Both CI workflows are currently blocked with action_required because this pull request originates from a fork. A maintainer of kunchenguid/firstmate needs to approve and run the workflows for this head. |
|
Head 8e4b399 now includes the Greptile P1 fix, the post-presentation redrain fix, the lock-loss read-only fallback, and the scoped removal of Pi ENOBUFS handling. The no-mistakes attestation for this exact head is published. Please approve and run workflows 32754863467 (Require no-mistakes) and 32754863582 (CI), which are currently action_required for this fork pull request. |
|
Speaking as Kun's firstmate: Scheduled 11:10am PT 8/24 pass. VISION.md read in full from current main VISION (inspected Class recirc: default-behavior (was corrective on 8/22). Wakes grow by default; not opt-in. Security: none. Local present/drain only; 0600 cache; packet/status/file bounds; no workflow-file / secret / injection path. Greptile is not a gate. Overlap: CI / NM: HEAD Workflows approved this pass: CI 32760559545, Require no-mistakes 32760559622. Not green at comment time. Land-eligible rec: NO (default-behavior; NM attestation mismatch; CI not yet green). Captain-flag NOW: no. This is a captain-decision if it should ever land as always-on wake growth. It is also waiting-on-author to regenerate |
|
Speaking as Kun's firstmate: recirc on current class=default-behavior. Bounded wake-context attaches to actionable wakes without an opt-in flag. Never auto-eligible. VISION.md: honest interface / token-lean context aligns; authority does not align as auto (new default presentation on every wake). Scripts align. Restart aligns. Spine mixed. Vendor aligns. Scope aligns. This HEAD: Waiting on author for a HEAD-matching |
|
Speaking as Kun's firstmate: recirc on current class=default-behavior. VISION.md (inspected
This HEAD: Security: none. Overlap: Land-eligible rec: NO. Captain-flag NOW: no (NM attestation mismatch is an author/CI blocker; the always-on product call waits until green CI + matching NM + no other blockers). This is a captain-decision if it should ever land as always-on wake growth. It is also waiting-on-author to regenerate |
|
Speaking as Kun's firstmate: recirc on current class=opt-in (was default-behavior last pass). VISION.md (inspected
This HEAD: Security: none. Local present/drain; 0600 cache; packet/status/file bounds; flag must be a regular file. Overlap: Land-eligible rec: NO (conflict; no CI on THIS HEAD; not safe to squash). Captain-flag NOW: no. This is waiting-on-author (conflict with current main; no CI on this HEAD). Not a captain-decision after the opt-in recirc. Not a merge I will recommend. |
26eb22e to
e6caefd
Compare
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
Intent
Corriger sur l’unique PR #2801 les défauts de timeout, fallback, staging du status cursor, ACK et replay afin d’éviter les réveils et tours modèle répétés, tout en rétablissant l’autorité explicite du captain sur l’augmentation de contexte. La présentation enrichie doit être désactivée par défaut et activée uniquement par un fichier local régulier , résolu via sinon , sans héritage implicite vers les secondmates. Sans opt-in et sans transaction publiée, ne doit effectuer aucun drain, cache, staging, reçu ou ACK et doit produire une instruction unique de drain manuel. Une transaction déjà publiée doit rester rejouable byte-identiquement après retrait du flag jusqu’à son ACK. Avec opt-in, conserver le comportement sécurisé validé au head fd8e3a7 pour Claude, Codex et Pi. Garder les tests comportementaux déterministes et fonctions sous 20 lignes. Ne pas prétendre prouver une baisse de tokens réels sans télémétrie. Ne pas traiter crash pendant ACK, replay transactionnel général, buffer Pi, pannes d’I/O ou processus hostiles. Mettre à jour uniquement la PR existante #2801, aucune seconde PR et aucun merge.
What Changed
Risk Assessment
🚨 High: La transaction ACK 0 peut perdre son replay avant acquittement, la deadline agrégée reste contournable, et deux contraintes explicites de l’intent nécessitent encore un arbitrage.
Testing
Le baseline a confirmé un worktree propre sur le commit cible. Les tests ciblés du contrat transactionnel et des intégrations Codex, Claude, Pi et secondmate sont passés. Un sous-cas Cursor hors intent a été ignoré faute d’exécutable. La vérification CLI démontre le mode désactivé sans mutation, la publication avec opt-in, le replay byte-identique après retrait du flag et l’ACK exact avec progression sans rejeu. Aucun screenshot n’est pertinent car la surface est exclusivement CLI. Cette phase ne prouve aucune baisse réelle de tokens faute de télémétrie.
Evidence: Transcription CLI du cycle wake-context
Source: Transcription CLI du cycle wake-context
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
tests/fm-watch-checkpoint.test.sh:90- L’intention exige « fonctions sous 20 lignes », mais le nouveau helperinstall_context_failure_checkpointcouvre les lignes 90 à 113, soit 24 lignes. Le même écart existe pourinstall_autoarm_wake_context_fixturedanstests/fm-claude-stop-autoarm.test.sh:25avec 22 lignes. Découper ces fixtures ou autoriser explicitement une exception pour les helpers de test.🔧 Fix: Découpe les fixtures sous vingt lignes
4 errors still open:
bin/fm-wake-context.sh:56- Le critère exige qu’une transaction publiée reste rejouable byte-identiquement jusqu’à son ACK. Avec un paquet status-only publié (reason_queue=[], ACK 0), puis une nouvelle wake avant ACK et le retrait du flag,cache_matches_queueexige une queue vide. Il invalide alors le cache, puis le contrôle du flag renvoie le fallback manuel. La nouvelle wake aurait pourtant survécu à l’ACK 0. Valider la transaction par son ACK et sa génération encore actifs, sans l’invalider à cause de wakes postérieures.bin/fm-wake-context.sh:374- Le critère « Sans opt-in et sans transaction publiée [...] doit produire une instruction unique de drain manuel » est contredit après perte du lock: le contrôle du lock précède celui du flag et renvoie uniquementWAKE_CONTEXT_READ_ONLY. Le chemin Pi est atteignable ettests/fixtures/pi-lock-loss-probe.mjs:32interdit explicitement l’instruction de drain. Comme demander un drain depuis une session read-only serait dangereux, faire arbitrer et documenter cette exception.bin/fm-wake-context.sh:384- La borne agrégée commence aprèscopy_queue,validate_queueetpreflight. Une queue très volumineuse ou de nombreux fichiers*.statuspeuvent donc être copiés et entièrement scannés sans deadline avant leur rejet. Placer ces opérations post-opt-in sous la frontièrefm_run_timed, tout en conservant le fallback pré-présentation lorsqu’aucun ACK n’existe.bin/fm-test-run.sh:133- Le critère requis « fonctions sous 20 lignes » reste contredit par quatre fonctions ajoutées ou modifiées:family_is_pure_contract_unitfait 20 lignes;tests/fm-wake-context.test.sh:186en fait 21; celles des lignes 303 et 604 en font 20. Le fix-round corrige bien les deux helpers précédemment signalés, mais pas ces quatre écarts.✅ **Test** - passed
✅ No issues found.
pwd;git rev-parse --show-toplevel;git branch --show-current;git rev-parse HEAD;git status --shortbin/fm-test-run.sh tests/fm-wake-context.test.sh tests/fm-watch-checkpoint.test.sh tests/fm-claude-stop-autoarm.test.sh tests/fm-pi-watch-extension.test.shbin/fm-test-run.sh tests/fm-secondmate-harness.test.shHarness CLI hermétique pilotantfm-wake-context.sh --presentpuisfm-wake-drain.sh --ack-through ... --recovery-generation ..., avec comparaisoncmpet SHA-256 des transactions et états persistéssed -n '1,240p' /Users/clement/.no-mistakes/evidence/01M0VMG51ST0RC582MTD15CD3J/wake-context-cli-transcript.txt;shasum -a 256 .../wake-context-cli-transcript.txt;git status --short;git rev-parse HEAD🔧 **Document** - 3 issues found → auto-fixed ✅
bin/fm-supervision-instructions.sh:163- Les instructions conditionnent encore le paquet au flag actif, contrairement au replay d’une transaction publiée après retrait du flag.bin/fm-watch-checkpoint.sh:14- L’aide promet un paquet alors que le mode par défaut peut produire une instruction de drain manuel.tests/fm-wake-queue.test.sh:233- Le commentaire affirme encore que le drain commence chaque tour de wake, contrairement au nouveau no-op et au replay enrichi.🔧 Fix: Clarify wake-context replay and Pi presentation scope
✅ Re-checked - no issues remain.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.