diff options
| author | Adam Malczewski <[email protected]> | 2026-06-05 13:07:23 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-05 13:07:23 +0900 |
| commit | c48d8ac7160c3cdcf32ed4e488807d3daeb8d457 (patch) | |
| tree | 1fccd7f35f051d8bae6bc8c6c5e3ffa22e816d0b /ORCHESTRATOR.md | |
| parent | 94dd5334b0277f3cf3b0588150a6615af86a32b3 (diff) | |
| download | dispatch-c48d8ac7160c3cdcf32ed4e488807d3daeb8d457.tar.gz dispatch-c48d8ac7160c3cdcf32ed4e488807d3daeb8d457.zip | |
feat(observability): Phase A logging substrate — Logger/Span ABI + journal sink (250 tests)
Structured, agent-first logging captured durably to an append-only journal file.
Kernel (contracts/logging.ts): leveled/attributed Logger + Span, auto-scoped per extension (host stamps manifest.id, unspoofable), incremental span records (open/close) for crash-reconstructable traces, injected LogSink (pure record-builder). ctx.log on ToolContract; runTurn opens turn/step/tool-call spans and captures the verbatim pre-mutation prompt (the 'before') on the step span.
journal-sink (new package, bootstrap dep — not an extension): LogSink appending NDJSON to a rotating journal; pure serialize + thin fs edge; fail-safe drop, never blocks a turn. host-bin injects it via HostDeps; session-orchestrator threads host.logger (childed per turn) into runTurn.
Redaction is per-extension self-redaction (no shared helper — isolation over DRY). The out-of-process collector + SQLite store + the verbatim 'after' provider.request capture are Phase B / next (notes/observability-design.md §10/§11).
Verified: tsc -b clean, 250 tests (218→+32), biome clean. Live boot: a turn's journal holds host logs + turn/step spans (open+close) + the prompt:before record with the verbatim messages array.
Harness: ORCHESTRATOR §3 rule-scoping map; .dispatch/rules/isolation-over-dry.md; notes/observability-design.md (design D1–D10 + Phase A/B plan).
Diffstat (limited to 'ORCHESTRATOR.md')
| -rw-r--r-- | ORCHESTRATOR.md | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/ORCHESTRATOR.md b/ORCHESTRATOR.md index afb5520..fdeb859 100644 --- a/ORCHESTRATOR.md +++ b/ORCHESTRATOR.md @@ -114,9 +114,10 @@ log into context as a hard failure. Write self-contained prompts. Structure: 1. **Role:** "You are the owner-agent for <unit>." -2. **Read first (ordered):** `AGENTS.md`, `.dispatch/rules/`, `GLOSSARY.md`, the - relevant `notes/restructure-plan.md` §-sections, and **the exact contract - files under `packages/kernel/src/contracts/` it builds against**. +2. **Read first (ordered):** `AGENTS.md`, the **scoped `.dispatch/rules/`** for this + unit's layer (the scoping map is below the recipe), `GLOSSARY.md`, the relevant + `notes/restructure-plan.md` §-sections, and **the exact contract files under + `packages/kernel/src/contracts/` it builds against**. 3. **Ownership (strict):** the EXACT files it may create/edit, and an explicit "do not touch anything else; if you need a change elsewhere, write a change- request in your report — do NOT edit it." @@ -138,6 +139,17 @@ Write self-contained prompts. Structure: Keep the prompt scoped (P6): don't restate what a frontier model knows; do state the project-specific, non-inferable rules. +**`.dispatch/rules/` scoping map** — include ONLY the rows matching the unit (per §0 +"scoped rules beat general rules"); do NOT dump every rule on every agent: +- **Every agent:** `one-owner.md`, `isolation-over-dry.md`. +- **Kernel unit:** `kernel-purity.md` + `pure-core.md` + `no-internal-mocks.md`. +- **Pure-core unit:** `pure-core.md` + `no-internal-mocks.md`. +- **Any extension coupling via hooks/services:** `typed-handles.md`. +- **Any extension that emits logs/spans (≈ all of them):** `extension-logging.md` + *(pending — authored with the observability substrate, see + `notes/observability-design.md` §9; keystone: each extension self-redacts its OWN + secrets in its OWN code — NO shared redaction helper).* + --- ## 4. Verification (the orchestrator's trust protocol) |
