[feat] /goal v2 production harden - #55
Conversation
Co-authored-by: Mathis <echobt@users.noreply.github.com>
Co-authored-by: Mathis <echobt@users.noreply.github.com>
Co-authored-by: Mathis <echobt@users.noreply.github.com>
Greptile SummaryThis change improves goal persistence and recovery behavior, but concurrent session activity can still discard a goal update. The concurrent-save issue must be resolved before merging; the corrupt-file reporting and legacy evidence cleanup issues are non-blocking but should be addressed for accurate recovery and status output. Confidence Score: 4/5Not safe to merge until concurrent goal saves cannot be interrupted by temporary-file cleanup. The remaining confirmed issues are non-blocking persistence and display consistency concerns. A reproduced concurrent persistence failure can prevent a user's updated goal state from being saved. Two additional reproduced issues affect recovery messaging and duplicate legacy evidence display. Files Needing Attention: src/cortex-engine/src/goal/persist.rs needs synchronization or stale-file detection for cleanup and accurate quarantine error handling. src/cortex-engine/src/goal/types.rs needs order-preserving global evidence deduplication.
What T-Rex did
|
Do not delete another process's in-flight goal temp on load. Only drop leftovers whose owner pid is gone. Say so when a corrupt goal.json cannot be moved aside, and dedup evidence across the whole list rather than adjacent pairs only. Co-authored-by: Mathis <echobt@users.noreply.github.com>
Child::wait needs a mutable Child; the unix leftover-temp regression was not compiling under libtest. Co-authored-by: Mathis <echobt@users.noreply.github.com>
Load no longer scans or removes .goal.json.tmp.* files. A concurrent save can keep its in-flight temp, then rename it onto goal.json instead of failing with ENOENT. Co-authored-by: Mathis <echobt@users.noreply.github.com>
Summary
Production harden of
/goallong-horizon persisted goals for the next Cortex CLI release (0.1.11).This follow-up to the merged
/goaltip keeps Cortex session harness state (persist, continue, wrap up). It does not add a second coding provider.goal.json; corrupt or empty-objective files are quarantined so session resume continuesgoal.jsoncannot be moved aside, the reason says it remains in place.goal.json.tmp.*, so a concurrent save's in-flight temp cannot be stolen (writer rename no longer ENOENT)/goal statusis a reserved status token; pause/resume/clear stay reserved only as the entire argumentUpdateGoalcomplete accepts onlyfile/command/test(normalized, globally deduped — not adjacent-only)Goal · 2/8/ paused / done / budget / blocked)0.1.11inVERSION_CLI, workspace package metadata,src/cortex-cli/VERSION, SDK package, changelog, and OpenAPI info versioncontinue-on-errorso a FinalizeArtifact HTTP 403 cannot fail the job after tests, doctests, contracts, and local QA already passedTip:
7fcedca9cd19a297ef9ae7970328c439f5bff77f(echobt).Test plan
cargo fmt --all -- --checkcargo test -p cortex-engine --lib goal::persist::— 9 passed, including two-process child-temp vs parent loadAttestation (required)
I attest that:
/goalsmoke still SKIP without an operator-injected key. Load never deletes another writer's goal temp.Goal · 2/8/ paused / done / budget / blocked). This revision does not change chip copy..envfiles are included.Risk
Harness-only
/goalstate on the session directory. Resume now survives a corruptgoal.jsoninstead of failing the session. Leftover.goal.json.tmp.*from a crashed writer are no longer auto-deleted on load (hidden files; the next save uses its own pid-scoped temp).Do not merge until Protect has the required review (Designer cli).