Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
255 changes: 129 additions & 126 deletions .ai/active/SPRINT_PACKET.md

Large diffs are not rendered by default.

165 changes: 165 additions & 0 deletions .ai/archive/planning/2026-04-07-phase9-bootstrap/CURRENT_STATE.md

Large diffs are not rendered by default.

232 changes: 232 additions & 0 deletions .ai/archive/planning/2026-04-07-phase9-bootstrap/SPRINT_PACKET.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
# SPRINT_PACKET.md

## Sprint Title

Phase 8 Sprint 32 (P8-S32): Outcome Learning and Closure Quality

## Sprint Type

feature

## Sprint Reason

P8-S31 shipped deterministic governed execution routing on top of P8-S29/P8-S30. The next non-redundant seam is closing the Phase 8 loop by capturing handoff outcomes, exposing closure quality signals, and feeding deterministic learning signals back into chief-of-staff supervision.

Planning anchors:

- `docs/phase8-product-spec.md`
- `docs/phase8-sprint-29-32-plan.md`

## Sprint Intent

Ship deterministic outcome-learning seams on top of shipped P8-S29/P8-S30/P8-S31:

- explicit handoff outcome capture/status semantics
- closure quality and conversion signal summaries
- stale/ignored escalation posture visibility
- `/chief-of-staff` outcome-learning and closure panel

## Git Instructions

- Branch Name: `codex/phase8-sprint-32-outcome-learning-closure-quality`
- Base Branch: `main`
- PR Strategy: one sprint branch, one PR
- Merge Policy: squash merge only after reviewer `PASS` and explicit Control Tower merge approval

## Why This Sprint

- It is the planned final Phase 8 seam after shipped routing capability.
- It turns routed handoffs into measurable closure outcomes.
- It completes recommendation-to-handoff-to-routing-to-learning feedback without widening autonomy.

## Redundancy Guard

- Already shipped baseline:
- Phase 4 release-control and MVP sign-off seams.
- Phase 5 continuity capture/recall/review/open-loop seams.
- Phase 6 trust calibration (`P6-S21` through `P6-S24`), complete as of March 31, 2026.
- Phase 7 chief-of-staff layer complete (`P7-S25` through `P7-S28`).
- Phase 8 Sprint 29 (`P8-S29`) action handoff artifacts and explicit non-autonomous posture.
- Phase 8 Sprint 30 (`P8-S30`) handoff queue lifecycle and operator review transitions.
- Phase 8 Sprint 31 (`P8-S31`) governed execution routing transitions and readiness posture.
- Required now (P8-S32):
- deterministic handoff outcome capture semantics
- closure quality summary and recommendation-to-execution conversion signals
- explicit stale/ignored escalation posture and feedback visibility
- Explicitly out of P8-S32:
- autonomous execution or external connector side effects
- redesign of P8-S29 handoff generation semantics
- redesign of P8-S30 queue/review lifecycle semantics
- redesign of P8-S31 routing semantics
- connector/channel/auth/orchestration expansion

## Design Truth

- Outcome learning must be deterministic for fixed state.
- Outcome capture must be explicit and auditable.
- Closure quality signals must be visible and explainable.
- Execution posture remains approval-bounded and non-autonomous.

## Exact Surfaces In Scope

- chief-of-staff handoff outcome-learning artifact/API seam
- closure quality and conversion summary seam
- stale/ignored escalation signal seam
- `/chief-of-staff` outcome-learning panel
- deterministic tests for outcome capture and learning rollups

## Exact Files In Scope

- `apps/api/src/alicebot_api/chief_of_staff.py`
- `apps/api/src/alicebot_api/contracts.py`
- `apps/api/src/alicebot_api/main.py`
- `apps/api/src/alicebot_api/tasks.py`
- `apps/api/src/alicebot_api/approvals.py`
- `apps/api/src/alicebot_api/memory.py`
- `apps/web/lib/api.ts`
- `apps/web/lib/api.test.ts`
- `apps/web/app/chief-of-staff/page.tsx`
- `apps/web/app/chief-of-staff/page.test.tsx`
- `apps/web/components/chief-of-staff-execution-routing-panel.tsx`
- `apps/web/components/chief-of-staff-execution-routing-panel.test.tsx`
- `apps/web/components/chief-of-staff-outcome-learning-panel.tsx`
- `apps/web/components/chief-of-staff-outcome-learning-panel.test.tsx`
- `tests/unit/test_chief_of_staff.py`
- `tests/integration/test_chief_of_staff_api.py`
- `README.md`
- `ROADMAP.md`
- `.ai/handoff/CURRENT_STATE.md`
- `BUILD_REPORT.md`
- `REVIEW_REPORT.md`
- `.ai/active/SPRINT_PACKET.md`

## In Scope

- Add deterministic outcome-learning fields on chief-of-staff payloads:
- `handoff_outcome_summary`
- `handoff_outcomes`
- `closure_quality_summary`
- `conversion_signal_summary`
- `stale_ignored_escalation_posture`
- Add explicit outcome-capture seam for routed handoff items:
- statuses: `reviewed`, `approved`, `rejected`, `rewritten`, `executed`, `ignored`, `expired`
- deterministic capture ordering and latest-state derivation
- immutable outcome capture records
- Add deterministic closure-learning behavior:
- recommendation-to-execution conversion signals
- stale/ignored escalation rollups
- explicit explanation payload for how outcome history affects guidance posture
- Add `/chief-of-staff` outcome-learning panel with outcome capture controls and closure metrics visibility.
- Add deterministic tests for outcome capture/status rollups and closure-learning summary behavior.

## Out of Scope

- automatic execution based on outcomes
- connector/channel expansion
- changes to shipped P8-S29 generation semantics
- changes to shipped P8-S30 queue/review semantics
- changes to shipped P8-S31 routing semantics

## Required Deliverables

- outcome-learning API/artifact seam
- deterministic outcome capture and closure rollup behavior
- stale/ignored escalation posture visibility
- `/chief-of-staff` outcome-learning UI panel
- unit/integration/web tests for outcome-learning behavior
- synced docs and sprint reports

## Acceptance Criteria

- routed handoff outcomes are captured with deterministic, explicit status semantics.
- closure quality and conversion signals are deterministic, auditable, and explainable.
- stale/ignored escalation posture is explicit and visible.
- approval-bounded non-autonomous posture remains preserved.
- `./.venv/bin/python -m pytest tests/unit/test_chief_of_staff.py tests/integration/test_chief_of_staff_api.py -q` passes.
- `pnpm --dir apps/web test -- app/chief-of-staff/page.test.tsx components/chief-of-staff-execution-routing-panel.test.tsx components/chief-of-staff-outcome-learning-panel.test.tsx lib/api.test.ts` passes.
- `python3 scripts/run_phase4_validation_matrix.py` remains PASS.
- `README.md`, `ROADMAP.md`, and `.ai/handoff/CURRENT_STATE.md` reflect active P8-S32 scope and preserve “P8-S29/P8-S30/P8-S31 shipped” truth.

## Implementation Constraints

- do not introduce new dependencies
- preserve shipped P5/P6/P7 semantics
- preserve shipped P8-S29 handoff-generation semantics
- preserve shipped P8-S30 queue/review semantics
- preserve shipped P8-S31 routing semantics
- keep side effects approval-bounded and explicit
- keep outcome-learning behavior deterministic and test-backed

## Control Tower Task Cards

### Task 1: Outcome Learning Engine + API

Owner: tooling operative

Write scope:

- `apps/api/src/alicebot_api/chief_of_staff.py`
- `apps/api/src/alicebot_api/contracts.py`
- `apps/api/src/alicebot_api/main.py`
- `apps/api/src/alicebot_api/tasks.py`
- `apps/api/src/alicebot_api/approvals.py`
- `apps/api/src/alicebot_api/memory.py`
- `tests/unit/test_chief_of_staff.py`
- `tests/integration/test_chief_of_staff_api.py`

### Task 2: Chief-of-Staff Outcome UI

Owner: tooling operative

Write scope:

- `apps/web/lib/api.ts`
- `apps/web/lib/api.test.ts`
- `apps/web/app/chief-of-staff/page.tsx`
- `apps/web/app/chief-of-staff/page.test.tsx`
- `apps/web/components/chief-of-staff-execution-routing-panel.tsx`
- `apps/web/components/chief-of-staff-execution-routing-panel.test.tsx`
- `apps/web/components/chief-of-staff-outcome-learning-panel.tsx`
- `apps/web/components/chief-of-staff-outcome-learning-panel.test.tsx`

### Task 3: Docs + Integration Review

Owner: control tower

Write scope:

- `README.md`
- `ROADMAP.md`
- `.ai/handoff/CURRENT_STATE.md`
- `BUILD_REPORT.md`
- `REVIEW_REPORT.md`

Responsibilities:

- verify no P6/P7/P8-S29/P8-S30/P8-S31 relitigation
- verify deterministic outcome capture and closure-learning semantics
- verify no hidden scope expansion
- verify no Phase 4 regression

## Build Report Requirements

`BUILD_REPORT.md` must include:

- exact outcome-learning contract delta
- exact deterministic outcome/closure summary behavior
- exact verification command outcomes
- explicit deferred Phase 8 follow-up scope after P8-S32

## Review Focus

`REVIEW_REPORT.md` should verify:

- sprint stayed P8-S32 scoped
- outcome-learning outputs are deterministic and explainable
- approval-bounded execution posture is explicit and preserved
- no hidden scope expansion
- Phase 4 validation remains green

## Exit Condition

This sprint is complete when Alice can deterministically capture handoff outcomes and present closure-quality learning signals that feed back into chief-of-staff supervision, without regressing shipped Phase 4/5/6/7 and P8-S29/P8-S30/P8-S31 behavior.
34 changes: 22 additions & 12 deletions .ai/handoff/CURRENT_STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

## Incomplete / At-Risk Areas

- no external adapter/importer interop has shipped yet beyond local MCP
- importer and adapter story is not yet public-ready
- importer coverage is still limited to one shipped adapter path (OpenClaw)
- broader importer story is not yet public-ready
- OSS license finalization is still open

## Current Milestone
Expand All @@ -30,7 +30,7 @@ Phase 9: Alice Public Core and Agent Interop

## Latest State Summary

`P9-S33`, `P9-S34`, and `P9-S35` are now shipped baselines:
`P9-S33`, `P9-S34`, `P9-S35`, and `P9-S36` are now shipped baselines:

- package boundary is documented around `alice-core`
- canonical local startup path is documented and script-backed
Expand All @@ -54,12 +54,22 @@ Phase 9: Alice Public Core and Agent Interop
- successful `alice_recall` and `alice_resume` calls
- correction via `alice_memory_correct` changing subsequent retrieval deterministically
- structured parity against shipped CLI/core behavior

The next active seam is `P9-S36`:

- implement OpenClaw adapter boundary on top of shipped CLI/MCP continuity contract
- OpenClaw adapter/import path exists for file-based workspace/export input:
- adapter modules: `openclaw_adapter.py`, `openclaw_models.py`, `openclaw_import.py`
- loader scripts: `./scripts/load_openclaw_sample_data.sh` and `load_openclaw_sample_data.py`
- deterministic fixture path: `fixtures/openclaw/workspace_v1.json`
- deterministic dedupe posture: workspace+payload fingerprint (repeat import returns noop duplicates)
- imported provenance is explicit via `source_kind=openclaw_import` and OpenClaw source metadata
- OpenClaw interop proof is covered by tests for:
- import -> recall/resumption behavior on imported scope
- shipped MCP `alice_recall`/`alice_resume` usage over imported data without MCP surface expansion
- ADR-004 defines the accepted OpenClaw integration boundary and scope constraints.

The next active seam is `P9-S37`:

- expand from single-adapter proof to broader importer coverage and evaluation harness work
- keep parity strict with existing deterministic continuity semantics
- avoid widening MCP transport semantics while adapter boundary is established
- avoid widening MCP transport semantics unless parity defects are found

## Critical Constraints

Expand All @@ -70,11 +80,11 @@ The next active seam is `P9-S36`:

## Immediate Next Move

Execute `P9-S36` on top of the `P9-S33`/`P9-S34`/`P9-S35` boundary:
Execute `P9-S37` on top of the shipped `P9-S36` boundary:

- build the first OpenClaw adapter using the shipped MCP wedge
- preserve deterministic continuity output semantics and correction parity
- keep startup/sample-data path unchanged while adapter support is added
- broaden importer coverage beyond OpenClaw using the same explicit provenance posture
- add benchmark/evaluation harness evidence for import quality and correction-aware continuity outcomes
- preserve startup/sample-data path and avoid MCP contract expansion unless needed for parity fixes

## Legacy Compatibility Markers

Expand Down
26 changes: 16 additions & 10 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ The current implementation already includes:

Phase 9 does not replace that architecture. It packages and exposes it through public-safe boundaries.

Current public-core packaging state is defined in `P9-S33`: one install path, one runtime baseline, and one deterministic sample-data fixture for recall and resumption verification.
Current public packaging baseline now spans `P9-S33` through `P9-S36`:

- `P9-S33`: public-safe core boundary and canonical local startup
- `P9-S34`: deterministic local CLI continuity contract
- `P9-S35`: narrow deterministic MCP transport contract
- `P9-S36`: first OpenClaw adapter/import boundary with provenance + dedupe posture

## Technical Stack

Expand All @@ -23,13 +28,14 @@ Current public-core packaging state is defined in `P9-S33`: one install path, on
- Vector support: `pgvector`
- Local infrastructure: Docker Compose, Redis, MinIO
- Testing: pytest, Vitest
- Packaging target for `P9-S33`:
- Shipped packaging/runtime baseline (`P9-S33` to `P9-S36`):
- `alice-core` (published package name in `pyproject.toml`)
- deterministic fixture loader (`scripts/load_sample_data.sh`)
- Deferred packaging targets (`P9-S34+`):
- `apps/cli`
- `apps/mcp-server`
- importer/adapter packages
- deterministic local CLI contract (`python -m alicebot_api ...`)
- deterministic local MCP transport (`python -m alicebot_api.mcp_server`)
- OpenClaw import loader and fixture path (`scripts/load_openclaw_sample_data.sh`)
- Deferred/next packaging targets (`P9-S37+`):
- broader importer set and evaluation harness outputs

## High-Level Architecture

Expand All @@ -50,13 +56,13 @@ Current public-core packaging state is defined in `P9-S33`: one install path, on
- resumption
- open-loop retrieval
- correction-aware memory behavior
2. `alice-cli` (deferred)
2. `alice-cli` (shipped baseline in `P9-S34`, module-scoped runtime)
- terminal access to public core flows
3. `alice-mcp-server` (deferred)
3. `alice-mcp-server` (shipped baseline in `P9-S35`, narrow tool contract)
- stable MCP tool surface for external assistants
4. `alice-importers` (deferred)
4. `alice-importers` (next seam in `P9-S37`)
- markdown, chat export, CSV, and adapter-backed imports
5. `alice-openclaw` (deferred)
5. `alice-openclaw` (shipped baseline in `P9-S36`, adapter-scoped import path)
- OpenClaw-specific ingestion and interop mapping

## Module Boundaries
Expand Down
Loading