Update documentation with 40 changed files (#1025) - #4745
Conversation
#1025) Wire the pure done-gate-driven completion decision layer into the live OODA daemon loop so a goal whose deliverable PR is merged/green with all success criteria met stops re-reflecting, instead of spinning further validation rounds forever. - src/ooda_loop/completion.rs: pure, side-effect-free decision layer (LoopDecision, ReflectionBounds, evaluate/goal_achieved/goals_all_achieved). Introduces no new evidence source; consumes the existing CompletionVerdict. - src/operator_commands_ooda/daemon/mod.rs: read ReflectionBounds::from_env at daemon start; emit one terminal graceful-completion log line per gate-verified goal; opt-in bounded no-progress safeguard (SIMARD_OODA_MAX_REFLECTION_CYCLES) yields stuck non-perpetual goals with a recorded blocker; opt-in graceful idle stop (SIMARD_OODA_STOP_WHEN_ACHIEVED) for bounded batch hosts. - Perpetual-safe defaults: bound disabled (0) and stop-when-achieved off, so standing instances stay perpetual and no goal is spin-capped unless opted in. - Perpetual/standing goals are always exempt from the bound. Tests: 22 completion unit + 5 daemon glue + 7 integration, all green. Docs: concept, howto, reference wired into mkdocs nav. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Automatic checkpoint to preserve work in progress. Tests and implementation saved before refactoring phase.
…ence doc Step 9 (refactor & simplify) over the issue #1025 graceful-completion work. - src/ooda_loop/mod.rs: narrow the completion re-export to ReflectionBounds (the only symbol the daemon consumes via the ooda_loop short path). The rest of the pure decision contract (LoopDecision, evaluate, goal_achieved, goals_all_achieved) stays reachable through ooda_loop::completion::* — how the acceptance tests already import it — shrinking an unused public surface with no behavior change. - docs/reference/ooda-graceful-completion-api.md: rewrite the Daemon wiring section to match the real code. It previously described a completion::evaluate per-goal loop calling mark_goal_achieved / record_reflection_bound_blocker helpers that do not exist; the daemon actually uses the done-gate newly_done graceful-completion log, reflection_bound_yields (delegating to the shared bound_exhausted predicate), and should_graceful_idle_stop (board-drain). Also corrects the goals_all_achieved idle claim and the Tests section. No production behavior change. Completion unit (22), daemon glue, and the #1025 integration acceptance suite (7) all green; cargo clippy --lib clean. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Review-pass (step 10) finding: two `manifest-derived-pin-invariants.md` pages (concepts + reference) landed on the #1025 branch during the step 7-8 WIP checkpoint. They document the P1018 manifest-derived pin feature whose code (`tests/issue_2626_amplihack_pin_bump.rs`) is NOT on this branch, are unregistered in mkdocs nav, and per the design sequence belong to the separate P1018 PR. Shipping them here would document an absent feature. Removed to keep the #1025 PR focused; content preserved for the P1018 work. No code paths reference these files; docs_integrity and the #1025 suites stay green. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Step 17b — Comprehensive Code Review (PR #4745, issue #1025)Reviewed the real diff (8 files, +1325): pure completion decision layer + daemon glue + docs + integration tests. Local ✅ Strengths
🔴 Blockers to "merge-ready" (CI green + mergeable)
🟡 Non-blocking suggestions
Checklist
Verdict: Implementation quality is solid and the design is sound, but the PR is not merge-ready: it conflicts with current |
Step 17c — Security Review (PR #4745, issue #1025)Scope: 8-file diff ( Checklist
Attack-surface analysisExternal inputs: exactly two, both environment variables read in
Both are trimmed and parsed with total functions. Malformed/empty/unset values degrade to safe perpetual defaults ( Sinks: all Absent risk classes (verified by scan):
DoS / resource considerationsThe feature is a bounding mechanism: it caps runaway no-progress reflection cycles (opt-in) and allows graceful idle-stop on an all-ACHIEVED board. Net effect is reduced resource-exhaustion risk vs. the prior uncapped loop. Defaults preserve existing perpetual behavior, so it is not a behavior/DoS regression for operators who don't opt in. ✅ VerdictNo security findings (P0/P1/P2). APPROVED on security grounds. Note (carried from Step 17b, non-security): the PR is still |
Step 17d — Philosophy Guardian Review (PR #4745, issue #1025)Assessed the completion decision layer against the project philosophy (ruthless simplicity, bricks & studs, zero-BS, no over-engineering, clean boundaries). Grounded in the actual 8-file diff.
Compliance verdict: ✅ PASS — philosophy-compliantThe implementation embodies ruthless simplicity and the brick/stud model well. It is a side-effect-free decision core with a narrow contract, fully regeneratable from its spec. One philosophy-adjacent note (non-blocking, carried from Step 17b)Two completion-decision entry points coexist: the daemon drives Note: merge-readiness blockers (merge conflict vs |
|
Auto-closing this stale CONFLICTING auto-generated documentation draft: it can no longer merge cleanly and is superseded by the canonical open auto-doc PR #4826. Enforcing the single-open auto-doc PR invariant (goal_hygiene). |
Summary
Concise workflow-generated PR for documentation.
Issue
Closes #1025
Changed files
Diff stat
Behavior
Implemented behavior through these branch commits:
7496332 chore(docs): drop misplaced P1018 manifest-pin docs from #1025 branch
ca89eb6 refactor(ooda): trim dead completion re-exports + correct #1025 reference doc
c4d81bb wip: checkpoint after implementation (steps 7-8)
fe456c3 fix(ooda): graceful ACHIEVED completion + bounded reflection safeguard (#1025)
Validation
ℹ NODE_OPTIONS=--max-old-space-size=32768 (saved preference). To change: /home/azureuser/.amplihack/config
I'll start by inspecting the branch and the actual changes to test.
● Get branch, diff stat, and status (shell)
│ cd /home/azureuser/src/Simard-deploy-4049/worktrees/feat/issue-1025-nodeoptions-max-old-space-si
│ ze32768-saved-preferen && git branch --show-current && echo "---DIFF STAT---" && git --no-pager
│ diff --stat HEAD~1 2>/dev/null | tail -30 && echo "---STATUS---" && git status --short
└ 7 lines…
● Show log and diff against merge base (shell)
│ cd /home/azureuser/src/Simard-deploy-4049/worktrees/feat/issue-1025-nodeoptions-max-old-space-si
│ ze32768-saved-preferen && echo "---LOG---" && git --no-pager log --oneline -10 && echo "---MERGE
Risk
No high-risk subsystem pattern detected from changed paths.
Checklist
This PR was created as a draft for review before merging.
Step 16b: Outside-In Testing Results
Detected toolchains: Rust CLI (
Cargo.tomlat root,cargo 1.95.0/rustc 1.95.0); Node wrapper (package.json+bin.js) is a thin launcher only. Changed surface is entirely Rust (src/ooda_loop/completion.rs,src/ooda_loop/mod.rs,src/operator_commands_ooda/daemon/mod.rs) plus docs.Chosen strategy: Per the qa-team skill's repo-type detection, Rust CLI repos use native
cargo testfor outside-in validation. Exercised the pure decision contract at the crate's public consumer boundary (simard::ooda_loop::completion) that the daemon consumes, plus the daemon-side glue that wires it intorun_ooda_daemon.cargo test --test issue_1025_graceful_achieved_completion7 passed; 0 failed— green PR ⇒GracefulComplete; criteria unmet ⇒Continue; stuck non-perpetual ⇒BoundExceeded; perpetual exemptcargo test --lib ooda_loop::completion22 passed; 0 failed— precedence of achievement over bound, env parsing/degradation,goals_all_achievedcargo test --lib operator_commands_ooda::daemon73 passed; 0 failed—idle_stop_requires_opt_in_and_drained_board,reflection_bound_yields_stuck_non_perpetual_goal,reflection_bound_exempts_perpetual_and_terminal_goals,reflection_bound_leaves_moving_goal_aloneFix count: 0 code fixes required. One transient object-write error (
No such file or directorywriting an incremental.rcgu.o) surfaced during the daemon compile — root cause was the build volume at 92% capacity, not a code defect. A clean re-run of the identical command passed 73/73.Verdict: The graceful ACHIEVED completion + bounded reflection safeguard behaves correctly at the outside-in consumer boundary: a gate-verified goal (green PR) terminates the loop instead of re-reflecting indefinitely (#1025), while perpetual/standing goals remain exempt and the safeguard is opt-in by default (non-breaking).