Private
Public Access
0
0

docs: agent workflow docs + regular docs (v2.3 surfacing)

Per user request 'use your remaining context to update agent workflow
docs and then regular docs based on what was discussed in this report',
this commit creates/updates 15 files derived from the v2.3 nagent
review (the 12 new nagent additions + the 4 memory dimensions
reframing + the cache strategy + the RAG discipline + the knowledge
harvest pattern).

Agent workflow docs (4 files):
- AGENTS.md (UPDATE): add @import line to canonical DOD + 'Code
  Styleguides' section pointing to the 6 new styleguides + new
  'Human-Facing Documentation' section pointing to ./docs/AGENTS.md
- conductor/workflow.md (UPDATE): new section 'Additions (2026-06-12)
  - the 12 patterns from the latest nagent corpus' with TDD
  protocols for knowledge harvest, cache ordering, compaction, RAG
  discipline
- conductor/product-guidelines.md (UPDATE): new sections 'Memory
  Dimensions (added 2026-06-12)' + 'See Also - Updated' with the
  6-styleguide catalog
- docs/AGENTS.md (NEW): the agent-facing mirror of docs/Readme.md
  (per the nagent CLAUDE.md pattern). 10 sections + the per-tier
  reading path + the 4 memory dimensions + the caching strategy +
  the knowledge harvest + the RAG discipline + the feature flags

Regular docs (11 files):
- 6 new styleguides (the convention catalog):
  * data_oriented_design.md: the canonical DOD reference (Tier
    0/1/2; 3 defaults to reject; 8 core defaults; 7-question
    simplification pass; 10-question self-check; 4 memory
    dimensions in Manual Slop context)
  * agent_memory_dimensions.md: the 4 memory dims (curation /
    discussion / RAG / knowledge) + when to use each + the
    boundaries
  * rag_integration_discipline.md: the conservative-RAG rule
    (opt-in, complement, provenance, no mutation, feature-gated,
    graceful failure)
  * cache_friendly_context.md: stable-to-volatile context
    ordering + the cache TTL GUI contract + the byte-comparison
    test
  * knowledge_artifacts.md: the knowledge harvest pattern
    (category files, provenance, sha256 ledger, digest
    regeneration, 'delete to turn off')
  * feature_flags.md: file presence vs config flags vs CLI flags
- 3 new project docs (the cross-cutting guides):
  * guide_agent_memory_dimensions.md: the cross-cutting guide on
    the 4 dims + the decision tree
  * guide_caching_strategy.md: caching across providers +
    stable-to-volatile ordering + cache TTL GUI + the byte-
    comparison test + the 5th provider (claude-code)
  * guide_knowledge_curation.md: the knowledge memory guide (4th
    dim) + the 5 category files + per-file notes + the digest +
    the ledger + the harvest workflow
- 2 existing doc updates:
  * guide_mma.md: new sections 'Delegation as context management'
    + 'The 4 memory dimensions (the MMA scope)'
  * guide_ai_client.md: new section 'Cache strategy and the 12-
    layer model' + the 5th provider (claude-code)

All files use the same style as the v2.3 review (the user's preferred
format): 7-column tables, no JSON, SSDL shape tags, forth/array
notation, file:line citations, ASCII sketches where useful. The
human Readme files (Readme.md, docs/Readme.md) are NOT modified
(per repeated user instruction).

The 5th provider (claude-code) is documented in guide_ai_client.md
+ the data_oriented_design.md references the nagent pattern as the
source of the canonical rules.

The cross-references are bidirectional: the 6 styleguides reference
the 3 project docs; the 3 project docs reference the 6 styleguides;
the 2 doc updates reference both; AGENTS.md + ./docs/AGENTS.md
provide the entry points.
This commit is contained in:
2026-06-12 13:50:40 -04:00
parent d604a63e1f
commit 35c6cca134
15 changed files with 3460 additions and 1 deletions
+84
View File
@@ -693,3 +693,87 @@ Whenever a track introduces a new convention that can be statically checked, add
**The audit-script + styleguide pair:** every audit script's documented "what it checks" should map to a section in a `conductor/code_styleguides/` file. The styleguide says "this is the rule"; the audit says "your code violates this rule." The pair is complete when both exist.
## Additions (2026-06-12) — the 12 patterns from the latest nagent corpus
This section extends the existing workflow with the patterns surfaced by the `nagent_review_20260608` review (v2.3, 2026-06-12). The patterns are:
1. **Knowledge harvest** (the 3rd memory dim): test-driven per the 7-category schema + the byte-equality test on the digest
2. **Stable-to-volatile cache ordering**: test the byte-equality of the first N chars across turns
3. **Conversation compaction**: test-driven per the 10-question self-review
4. **RAG integration**: test the "no mutation" invariant + the graceful failure
### The knowledge harvest TDD protocol
**The shape.** The harvest's LLM output is strict JSON. The test is the parser's contract:
```
- [ ] tests/test_knowledge_store.py: 5+ tests for the 7-category schema
- [ ] parse_harvest_json: 7 categories; rows must be lists
- [ ] parse_harvest_json: rejects prose
- [ ] parse_harvest_json: tolerates ```json ... ``` code-fence
- [ ] parse_harvest_json: rejects non-dict payloads
- [ ] regenerate_digest: 4KB cap; truncation with note
- [ ] tests/test_knowledge_harvest.py: 8+ tests for the pipeline
- [ ] classify (live/user-kept/prune/harvest/keep)
- [ ] merge_harvest per category
- [ ] per-file knowledge: existing-file branch
- [ ] per-file knowledge: missing-file branch
- [ ] ledger dedup (sha256-of-content)
- [ ] retry budget (2 attempts)
- [ ] "too-large" budget guard (1MB)
- [ ] "delete to turn off" regeneration
```
### The cache ordering TDD protocol
**The shape.** The byte-equality of the first N chars is the design contract. The test:
```
- [ ] tests/test_aggregate_caching.py: the byte-comparison test
- [ ] first N chars are identical across turns of the same discussion
- [ ] N = aggregate.stable_prefix_length(ctrl)
- [ ] failure modes: new layer in wrong position, volatile input leak
- [ ] tests/test_cache_state.py: 3+ tests for the cache state machine
- [ ] per-provider TTL defaults
- [ ] DiscussionCacheState lifecycle
- [ ] invalidate + regeneration
- [ ] tests/test_gui_caching.py: 3+ live_gui tests for the "Caching" panel
- [ ] panel renders provider summaries
- [ ] invalidate button
- [ ] per-discussion disable/enable
```
### The compaction TDD protocol
**The shape.** The compaction's LLM output is the 12-section structure. The 10-question self-review is the contract. The tests:
```
- [ ] tests/test_run_discussion_compaction.py: 10+ tests
- [ ] compact preserves decisions
- [ ] compact preserves constraints
- [ ] compact preserves failures
- [ ] compact preserves artifact refs
- [ ] compact removes duplicates
- [ ] compact replaces chronology with state
- [ ] compact is substantially smaller
- [ ] compact preserves capability
- [ ] compact returns 12-section structure
- [ ] compact continues until self-review passes
```
### The RAG discipline TDD protocol
**The shape.** RAG is opt-in, never mutates state, fails gracefully. The tests:
```
- [ ] tests/test_rag_discipline.py: 4+ tests
- [ ] RAG disabled: no {rag-context} block
- [ ] RAG results have provenance (file path + chunk)
- [ ] RAG results do not mutate disc_entries
- [ ] RAG failure returns empty (graceful)
```
See `conductor/code_styleguides/knowledge_artifacts.md`, `cache_friendly_context.md`, `rag_integration_discipline.md` for the canonical styleguides.
---