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
46 changes: 46 additions & 0 deletions docs/briefs/ctrl-migration-day1-manager-dispatch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Ctrl-Migration Day-1 Manager Dispatch

**Status**: ACTIVE — Director dispatch artifact for `node://adhoc-dc298bc7-9f7` (2026-05-12).

**Charter authority**: PR #2775 (`docs/design-decomposition-algebra.md` + `docs/r4-ctrl-dag-migration-project-plan.md` on branch `design/decomposition-algebra-draft`). The charter is binding from PM dispatch even while the doc PR is still open.

**Mission**: replace `ctrl/` TypeScript implementation with `.dag` substrate as fast as the substrate/emission/parity trio allows. Every `.dag` subsystem model lands as 🟡 STAGED until emission target + parity test + cut-over PR deletes the TS authority.

## Manager Work Items

The Director attempted to create the four Day-1 manager work items with `dashboard-ops work-items create`, but the dashboard CLI currently fails from this container with:

```text
dashboard-ops: curl failed (network/DNS/connect error)
```

Once dashboard transport is restored, create these four work items:

1. **Ctrl-Migration Substrate Mgr — Phase 1 process algebra substrate**
- Owns `dsl/std/process_algebra.dag` plus the `Attestation` carrier.
- First output: Phase 1 worker brief from `docs/design-decomposition-algebra.md` §9.
- Gate: M9 DFS trace to `dsl/std/`, `src/v3/std/`, and `src/v3/lenses/` for every carrier name.

2. **Ctrl-Migration Subsystem-Modeling Mgr — Phase 1.5 subsystem .dag contracts**
- Owns the 16-subsystem catalog from project-plan §3.
- First wave: items #3, #5, #8, #10, #11, #12, #14, #16.
- Gate: each subsystem file names the current ctrl TS authority and the STAGED -> AUTHORITY trigger.

3. **Ctrl-Migration Emission-Targets Mgr — Phase 3 HTTP SQL audit extdeps**
- Owns `dsl/extdeps/http/server.dag`, `dsl/extdeps/sql/migration.dag`, and `dsl/extdeps/audit/event.dag`.
- First output: HTTP server extdeps brief.
- Gate: no runtime cut-over claims until a subsystem projection consumes the target and parity passes.

4. **Ctrl-Migration Verification Mgr — Phase 4 parity tests and cut-over PRs**
- Owns per-subsystem parity tests and TS deletion cut-over PRs.
- First output: parity harness plan for review verdict, inbox, and API reviewer.
- Gate: generated consumer receipt required before any staged model becomes authority.

## Director Enforcement Rules

- M9 DFS before naming any new carrier.
- Grep `dsl/std/`, `src/v3/std/`, and `src/v3/lenses/` before accepting a substrate proposal.
- Practice 4 receipts on every enum/sum with at least two variants, including closed sums.
- No parallel authority: reuse existing `src/v3/std/lens.dag::Lens<C>` and `src/v3/std/dimensions.dag::Witness<C>` rather than defining similarly named substitutes.
- `.dag` declarations are staging until the realization trio converges: emission target, parity test, and TS cut-over deletion.

38 changes: 38 additions & 0 deletions docs/briefs/ctrl-migration-emission-http-brief.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Ctrl-Migration HTTP Emission Target Brief

**Status**: READY-FOR-DISPATCH once the Emission-Targets Mgr exists.

**Authority**: Ctrl-Migration project plan §4 and §6 from PR #2775.

## Output

Author the first HTTP server emission-target design and substrate slice for ctrl replacement:

- `dsl/extdeps/http/server.dag` or a narrower first slice if the existing extdeps layer requires a different path.
- Route declaration carrier.
- Request body/query/path parameter carriers.
- Response status/body carriers.
- Handler binding shape that can point at a `.dag` service operation.

## Scope

This target enables generated ctrl HTTP handlers; it does not need to replace SQL persistence, audit events, browser automation, or cron in the same PR.

## Required Reuse Audit

Inspect before adding carriers:

- `dsl/extdeps/transports/rest.dag`
- `dsl/std/http_path.dag`
- `dsl/extdeps/github/*.dag`
- `src/v3/std/services.dag`
- `docs/lane4-completion.md`

## Acceptance Gates

1. Route shape composes from existing REST/path/service primitives where possible.
2. Every enum/sum with at least two variants has a Practice 4 receipt.
3. The target can express `POST /api/internal-work-items` and `POST /api/nodes/:id/declare` as examples without hardcoding ctrl-specific routes.
4. The brief names the first consumer subsystem, expected to be work-item API or inbox delivery.
5. No cut-over claim is made before a generated handler passes parity.

60 changes: 60 additions & 0 deletions docs/briefs/ctrl-migration-first-wave-subsystem-briefs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Ctrl-Migration First-Wave Subsystem Briefs

**Status**: READY-FOR-DISPATCH once the Subsystem-Modeling Mgr exists.

**Authority**: Ctrl-Migration project plan §3 from PR #2775. These items are independent of Phase 1 process-algebra substrate and can proceed immediately as staged service contracts.

## Shared Brief Contract

Every worker owns one `dsl/ctrl/<subsystem>.dag` file unless the manager explicitly folds utility helpers into a consumer subsystem.

Acceptance gates:

1. Declare service contracts, carriers, projections, and pure helper signatures for the subsystem.
2. Name every current ctrl TS source file that remains runtime authority.
3. Add Practice 4 receipts for every enum/sum with at least two variants.
4. Mark the file 🟡 STAGED and name the consumer receipt that upgrades it to authority.
5. Avoid new std-like carrier names unless the worker provides an M9 DFS non-reuse proof.

## Wave 1 Items

1. **Inbox Delivery** (`dsl/ctrl/inbox.dag`)
- Source authority: `scripts/session-dashboard/inbox_policies.mjs`, `inbox_schema.mjs`, and `INBOX_DESIGN.md`.
- Reuse the existing demo shape from `research/market/viability/demos/agent-ctrl-session-dashboard/inbox_delivery_slice.dag` where applicable.
- Consumer receipt: generated inbox delivery projection plus parity tests over existing inbox delivery fixtures.

2. **Session Lifecycle** (`dsl/ctrl/session_lifecycle.dag`)
- Source authority: `sessions_schema.mjs`, `watcher.mjs`, `container_runtime.mjs`, `runtime_tmux.mjs`, `runtime_helpers.mjs`, `SESSION_LIFECYCLE.md`, and `CONTAINER_LIFECYCLE.md`.
- Model spawn/idle/archive emergence as state projections, not as textual scheduler convention.
- Consumer receipt: generated lifecycle classifier matches dashboard session rows across open/idle/archived examples.

3. **PR Digests** (`dsl/ctrl/pr_digests.dag`)
- Source authority: `pr_attached_urls.mjs`, `pr_ci_digest.mjs`, `pr_conflict_digest.mjs`, `pr_merge_ready_digest.mjs`, and `pr_rest_fallback.mjs`.
- Preserve digest subject identity: repo, PR number, head SHA, and observed artifact source.
- Consumer receipt: generated digest output matches current digest formatter fixtures.

4. **Work Advancement Prompts** (`dsl/ctrl/work_prompts.dag`)
- Source authority: `work_advancement_prompts.mjs`.
- Model prompt components as typed inputs; avoid treating the prompt body as the only authority.
- Consumer receipt: generated prompt rendering matches existing expected messages.

5. **Analyses Pipeline** (`dsl/ctrl/analyses.dag`)
- Source authority: `analyses_api.mjs`, `analyses_sync.mjs`, `analyses_sync_targets.mjs`, and `analyses_table.mjs`.
- Preserve run identity, target identity, sync status, and artifact links as separate axes.
- Consumer receipt: generated analysis sync table matches existing DB query results.

6. **CI Integration** (`dsl/ctrl/ci.dag`)
- Source authority: `ci.mjs`.
- Model check suite state and merge-blocking decision as typed projections.
- Consumer receipt: generated CI gate result matches current dashboard CI classifier over sample GitHub payloads.

7. **API Reviewer** (`dsl/ctrl/api_reviewer.dag`)
- Source authority: `scripts/api-reviewer/review-one.mjs`, `review-with-cli.mjs`, and `review-meta-with-cli.mjs`.
- Model provider selection, OAuth/API-key policy, review invocation, stale-PR exit, and posting contract.
- Consumer receipt: generated invocation contract matches dry-run CLI behavior for codex/claude/cursor/openai-pro.

8. **Utility Helper Consolidation**
- Source authority: `disk_pressure.mjs`, `effort_picker.mjs`, `parse_int_env.mjs`, `transcript_excerpt.mjs`, plus helper uses inside the above subsystems.
- Default disposition: fold helpers into the consuming subsystem file rather than creating a standalone utility substrate.
- Consumer receipt: helper behavior parity is covered by the consuming subsystem tests.

49 changes: 49 additions & 0 deletions docs/briefs/ctrl-migration-substrate-phase1-brief.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Ctrl-Migration Substrate Phase 1 Brief

**Status**: READY-FOR-DISPATCH once the Substrate Mgr exists.

**Authority**: PR #2775 companion doc `docs/design-decomposition-algebra.md`, especially §2, §5, §6, and §9.

## Output

Author `dsl/std/process_algebra.dag` as the staged substrate for ctrl decomposition algebra:

- `ProcessNodeId`
- `ProcessNodeMode` (`Leaf`, `Composite`, `Bucket`, and staged undeclared/null handling if needed)
- `ProcessOperation`
- `ProcessClosureDecision`
- `ProcessClosureRefusal`
- `Attestation`
- typed drain/replan/escalation evidence

## Scope

This is not a ctrl runtime cut-over. The file is 🟡 STAGED until:

1. an emission target consumes it,
2. parity tests prove the generated behavior matches ctrl PRs #1192/#1193/#1195/#1197 behavior,
3. the ctrl TS decomposition files are deleted or made generated-only.

## Mandatory Audits

Before naming any carrier, grep and cite non-reuse/reuse against:

- `dsl/std/`
- `src/v3/std/`
- `src/v3/lenses/`
- `dsl/gunbc/workflow/types.dag`

Known hazards:

- Do not define a new `Witness`; v3 already has `Witness<Carrier>` in `src/v3/std/dimensions.dag`.
- Do not define a parallel bidirectional `Lens<S,A>`; v3 already has `Lens<C>` in `src/v3/std/lens.dag`.
- Preserve workflow phase and run-keyed facts as separate axes; do not collapse them into node mode.

## Acceptance Gates

1. Every enum/sum with at least two variants has a Practice 4 receipt.
2. The file explicitly marks each staged carrier and its dissolution trigger.
3. Closure checks are fail-closed: undeclared post-cutoff mode, undrained bucket, and composite-with-open-children are representable refusals.
4. Operation effects are typed per operation; no blanket monotonicity claim.
5. The PR body names the ctrl TS files that remain current runtime authority.

41 changes: 41 additions & 0 deletions docs/briefs/ctrl-migration-verification-phase4-brief.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Ctrl-Migration Verification Phase 4 Brief

**Status**: READY-FOR-DISPATCH once the Verification Mgr exists.

**Authority**: Ctrl-Migration project plan §6 and §8 from PR #2775.

## Output

Define the parity and cut-over discipline for staged ctrl `.dag` subsystem contracts.

First verification targets:

1. `dsl/ctrl/review_verdict.dag`
2. `dsl/ctrl/inbox.dag`
3. `dsl/ctrl/api_reviewer.dag`

## Parity Contract

For each subsystem, the manager must produce:

- a fixture inventory from current ctrl tests or representative DB/API rows,
- a generated-consumer receipt showing the `.dag` model is exercised structurally,
- a comparison harness that fails closed on missing or ambiguous evidence,
- a cut-over checklist that deletes or generated-only freezes the TS authority.

## Review Verdict Baseline

`dsl/ctrl/review_verdict.dag` is already staged in this Director PR. Its parity tests must cover:

- SHA marker selection with no recency fallback,
- whole-comment fallback as an explicit degraded state,
- approving verdict count by distinct provider,
- request-changes and blocking-finding exclusion from merge readiness,
- actionable feedback routing for `Blocking`, `P0`, and `P1`.

## Acceptance Gates

1. No staged model is marked authority until the generated consumer runs in CI or an equivalent dashboard parity gate.
2. Every cut-over PR deletes the old handwritten TS authority or marks it generated-only.
3. Residual manual steps are named as follow-up work items, not hidden in prose.

Loading
Loading