Skip to content

feat(work-loop): harden scoped conformance gates - #76

Open
verioussmith wants to merge 170 commits into
mainfrom
local/work-loop-completion
Open

feat(work-loop): harden scoped conformance gates#76
verioussmith wants to merge 170 commits into
mainfrom
local/work-loop-completion

Conversation

@verioussmith

Copy link
Copy Markdown
Member

Summary

  • add provider-neutral WorkItem lifecycle transitions while preserving Spec116 closure authority
  • scope all Workloop runtime HTTP harnesses by project root and continuity
  • align Spec98/104/133 static contracts, authority-plane inventory, durable namespaces, and daemon-native Silent Session semantics
  • add fail-closed Spec133 Phase 8 backend and Phase 9 exhaustive runtime gates

Local proof

  • all Spec98/104/133 static tests
  • selected Workloop static contract tests
  • cargo fmt --all -- --check
  • git diff --check

Deferred to PR CI

  • Cargo/runtime, multi-daemon CRDT, process-tree, cross-platform, and real-Pi lifecycle execution per operator policy

Workloop remains fail-closed and is not claimed complete until the runtime and final acceptance gates pass.

@verioussmith
verioussmith force-pushed the local/work-loop-completion branch 7 times, most recently from a4c870f to 381383a Compare July 27, 2026 08:26
@verioussmith
verioussmith force-pushed the local/work-loop-completion branch from 0b0374d to 867aaa7 Compare July 27, 2026 09:11
…ceipt, commit, and rollback

- shared pi_package module: retire verified Focusa-owned legacy/backup/old
  entries to a sibling non-discovery root (retired-extensions); activation
  backups live outside the active extensions root; typed activation receipt
- OTA apply retains the receipt in transaction state, rolls the Pi package
  back with promoted binaries on any downstream failure, commits the prior
  backup only after settlement, and records the Pi entry in the rollback ledger
- FOCUSA_UPDATE_FAULT_AFTER_PI_ACTIVATION fault injection proves rollback
  after activation; new transaction tests cover activation/commit/rollback,
  retirement identity gating, and the OTA fault path
- static policy gate extended and wired into pre-push and CI; AGENTS.md
  one-canonical-Pi-package rule; INSTALLER_UPDATE_POLICY.md transaction policy

Beads: focusa-309
…fication (#311)

- event_retention engine (focusa-core): batched epoch-junk pruning, hot-window
  export to cold JSONL, hash-chain anchoring with meta checkpoint, bounded
  incremental vacuum; daily daemon retention sweep + POST /v1/events/prune +
  focusa events prune CLI
- silent-session completion events (focusa-core): durable deduped ledger
  (UNIQUE session/run/status) with latest lookup and since_seq backfill
- silent_sessions_wait route: long-poll wait endpoint, completions backfill,
  forced sweep; 30s daemon sweeper broadcasts silent_session_completed over
  the existing SSE channel; focusa silent wait CLI
- Pi extension session.ts: single uiCtx.notify on silent-session completion
  so background terminals report into the originating terminal (TBQ rule)
- docs: 158 retention architecture + runbook, 159 completion-notification
  design, 160 Pi package activation transaction (#309), and the TBQ
  background-execution discipline runbook

Beads: focusa-311
…th, audits, schemas

- #302: demo-golden-workflow reads nested project_identity fields and renders
  entitlement-gated 4xx bodies instead of aborting curl -f
- #303: register SetupCmd::Walkthrough so the deprecation alias points at a
  real subcommand
- #304: inferToolResult consults the canonical tool contract registry first;
  descriptor prose can no longer be read as the call outcome (no false
  validation_rejected/focus_state on read-only discovery)
- #305: prove/audit scripts distinguish authority-gated 403s and typed
  validation responses from daemon_unavailable; safe fixtures carry bounded
  scope inputs
- #306: tool_result_v1 output schema declares every envelope field (tool,
  family, endpoint, workpoint_id, reflex_suggestions, ontology refs, error,
  raw) and the not_found status

Beads: focusa-302, focusa-303, focusa-304, focusa-305, focusa-306
docs/164 invariant 1 now enforced at the canonical scoped write sites:
the partition is updated in memory AND persisted per workstream
(state.sqlite via partition_paths); the global state remains the
compatibility projection. Conformance audit documented.

Beads: focusa-125
get_or_create loads the persisted per-workstream state.sqlite when the
in-memory store misses — restart resumes the exact root. The deslop
checks list now includes the bg-notification contract (no raw shells,
no tail polling).

Beads: focusa-125
The SSE handler consumed broadcast messages and dropped them — bg
completions and silent-session sweeps never reached any SSE client
(only durable-replay history did). Live events now yield to every
subscriber; history still replays from SQLite.

Beads: focusa-311
Five mandatory proofs (contract, producer, consumer, interop, live
e2e); the bg-notification feature is the reference implementation,
with the legacy-shape consumer interop test.

Beads: focusa-311
Per-name EMA duration stats feed the ETA; the daemon status carries
elapsed_ms + eta_ms; the Pi status line renders an animated spinner +
progress bar for running jobs (1s refresh, never blocks). Session
start wires the widget; completions clear it.

Beads: focusa-311
… A-C)

POST /v1/evidence/research-packet ingests UIAI packets as typed
evidence refs (the hand-in-glove seam); bg receipts cover acceptance
atoms by name convention; met workset requirements supply their
evidence to completion claims — one evidence vocabulary across the
flywheel.

Beads: focusa-252
The guard validated every scope_kind key against the query vocabulary
(fresh_question/meta/...), rejecting ScopeRef bodies with
ScopeKind::Project/Host — breaking the predictions route and any
typed-scope body. Both vocabularies now validate; regression tests.

Beads: focusa-261
Adds the per-turn metacognition+prediction loop, tool flywheel/health
discipline, dynamic-scope discipline, and turn-closure rules to AGENTS.md;
INDEX gains the missing 2026-08-16 entries + the route-health sweep.

Beads: focusa-252
…(gaps D/E/F)

Gap D: Steer operations re-rank next-ready selection in the workloop
(deterministic steer x 10000 bump, ledger-backed).
Gap E: GET /v1/cockpit/projection joins workset summaries, open
CallGraph frontiers, direction steers, and the bg board with EMAs.
Gap F: scripts/deslop-bg-run.sh runs deslop through focusa bg; its
receipt covers the deslop-ceiling acceptance atom via the gap C bridge.

Beads: focusa-252
Secret-free routes: verify-requirement (verdict only), grant-status
(lifecycle state + role ref), providers (ledger-backed projection
stub). The provider adapter seam consumes verdicts before any use.

Beads: focusa-299
…ction counts)

The workset list now survives unparsable definitions and reports
requirement/membership/settled counts per row.

Beads: focusa-267
AppState import path, sync store helpers inside spawn_blocking (no
await-in-sync), i64->u64 revision conversion, pub module registration.

Beads: focusa-252
The outer Some-destructure already yields &DateTime<Utc>; the inner
Ok-pattern was a type error that survived since the transient edit.
Duration stats (and per-name ETA) now actually compile.

Beads: focusa-311
The grant_state tests called a helper scoped to another test module;
only the full-workspace test phase caught it. The helper is now local
to lifecycle_tests.
@verioussmith
verioussmith force-pushed the main branch 2 times, most recently from e4edabb to d1d7d80 Compare August 19, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant