Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ba65f91
refactor(rename): demolition — delete dead purge-learning migrations …
dean0x Jul 14, 2026
2584315
refactor(rename): path layer lockstep — collapse dream/+decisions/ in…
dean0x Jul 14, 2026
424a6c1
refactor(rename): feature-config module — DreamConfig→FeatureConfig, …
dean0x Jul 14, 2026
c13f7e8
refactor(rename): new migrations — consolidate dream+decisions to lea…
dean0x Jul 14, 2026
f2a2f12
refactor(rename): shell hooks + CJS renderer — dream/decisions → lear…
dean0x Jul 14, 2026
8fce3ed
refactor(rename): test suite — decisions/dream paths → learning (full…
dean0x Jul 14, 2026
4605c8e
refactor(rename): CLI surface — decisions→learning command, dream→leg…
dean0x Jul 14, 2026
ac3d85f
refactor(rename): HUD — decisionsCounts→learningCounts component and …
dean0x Jul 14, 2026
4e816d0
refactor(rename): agent/MDS/plugin registry — dream→learning agent, r…
dean0x Jul 14, 2026
4717b14
test: align test suite to renamed manifest/feature fields and new age…
dean0x Jul 14, 2026
f0c62ff
refactor: strip tombstone rename-history comments from project-paths
dean0x Jul 14, 2026
517d39d
chore: delete shared/agents/dream.md and remove bridge test exclusions
dean0x Jul 14, 2026
30a622e
docs: rewrite all docs to describe learning end-state only
dean0x Jul 14, 2026
f649a19
chore(knowledge): remove stale dream-capture-system knowledge base
dean0x Jul 14, 2026
e8de6cc
fix: repoint decisions-index consumers to .devflow/learning/
dean0x Jul 14, 2026
1992fe0
fix: update gitignore-writer and renderer comments to learning end-state
dean0x Jul 14, 2026
b3c8a27
docs(knowledge): add learning-capture-system feature knowledge base
dean0x Jul 14, 2026
482cd3c
docs(knowledge): refresh feature KBs to learning end-state
dean0x Jul 15, 2026
2212257
fix(learning): route --configure global write through getDevFlowDirec…
dean0x Jul 15, 2026
fbed892
fix(init): remove writeDreamConfig alias and update stale Dream comments
dean0x Jul 15, 2026
ee39aa2
test(learning-agent): fix TOCTOU flake and tighten 900s staleness ass…
dean0x Jul 15, 2026
f773aad
fix(learning-tuning-config): tighten model type to union and add obje…
dean0x Jul 15, 2026
4b2a5e4
refactor(project-paths): delete three dead path constructors (ISS-06)
dean0x Jul 15, 2026
815d90f
fix(feature-config): export DEFAULT_CONFIG and fix coerceConfig JSDoc
dean0x Jul 15, 2026
2f39646
fix(migrations): consolidate-dream-decisions-to-learning corrections
dean0x Jul 15, 2026
212fc52
refactor: simplify seedFeatureConfigFromDream and remove FIX tombston…
dean0x Jul 15, 2026
f1c8339
docs: fix stale Dream reference and migration scope label
dean0x Jul 15, 2026
6031af6
refactor: complete Dream→Learning rename residue cleanup
dean0x Jul 16, 2026
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
4 changes: 2 additions & 2 deletions .devflow/features/ambient-orchestrator/KNOWLEDGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "Use when modifying the ambient mode hooks (preamble, session-start
category: architecture
directories: [scripts/hooks, src/cli/commands/ambient.ts, plugins/devflow-ambient]
created: 2026-07-04
updated: 2026-07-12
updated: 2026-07-15
---

# Ambient Orchestrator Mode
Expand Down Expand Up @@ -173,7 +173,7 @@ The model-tier routing table (haiku/sonnet/opus taxonomy) is a second intentiona
- ADR-004: Decision to pivot from detection-based to charter-based ambient mode (applies ADR-004)
- ADR-003: Leave-the-end-state principle; the old keyword/3-marker detection was deleted clean, no tombstones (applies ADR-003)
- PF-001: Plan-handoff schema undocumented/mutable — match by prefix only; the `tests/fixtures/ambient-templates.ts` constants are full output strings, not detection substrings (avoids PF-001)
- Feature knowledge: `dream-capture-system` — the memory worker fires UserPromptSubmit and SessionStart hooks too; the `DEVFLOW_BG_UPDATER` re-entrancy guard is the coupling point between that system and this one
- Feature knowledge: `learning-capture-system` — the memory worker fires UserPromptSubmit and SessionStart hooks too; the `DEVFLOW_BG_UPDATER` re-entrancy guard is the coupling point between that system and this one
- Feature knowledge: `feature-knowledge-system` — the charter's feature-knowledge operating rule instructs the orchestrator to load KNOWLEDGE.md entries as FEATURE_KNOWLEDGE and spawn the Knowledge agent after changes; that system's KB covers how those entries are written and consumed
- `scripts/hooks/json-parse` — shared JSON output helpers (`json_prompt_output`, `json_session_output`, `json_extract_cwd_prompt`)
- `scripts/hooks/hook-bootstrap` — shared hook initialization: debug logging, per-project log paths
Expand Down
370 changes: 0 additions & 370 deletions .devflow/features/dream-capture-system/KNOWLEDGE.md

This file was deleted.

4 changes: 2 additions & 2 deletions .devflow/features/dynamic-workflow-engine/KNOWLEDGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ directories:
- plugins/devflow-dynamic/commands
- tests/build-mds.test.ts
created: 2026-07-07
updated: 2026-07-07
updated: 2026-07-15
---

# Dynamic Workflow Engine
Expand Down Expand Up @@ -142,7 +142,7 @@ The preference profile (`~/.devflow/preference-profile.md`) auto-resolves decisi

### DECISIONS_CONTEXT loading

The main model reads `.devflow/decisions/index.md` (the pre-rendered write-time artifact) **before authoring the workflow script** — the script body has no filesystem access. The returned index is injected into agent prompts using the `devflow:apply-decisions` algorithm. Only agents that need architectural context (Coder, Evaluator, Reviewer, Scrutinizer) need it injected; Validator and Simplifier do not.
The main model reads `.devflow/learning/index.md` (the pre-rendered write-time artifact) **before authoring the workflow script** — the script body has no filesystem access. The returned index is injected into agent prompts using the `devflow:apply-decisions` algorithm. Only agents that need architectural context (Coder, Evaluator, Reviewer, Scrutinizer) need it injected; Validator and Simplifier do not.

### Agent agentType usage

Expand Down
20 changes: 10 additions & 10 deletions .devflow/features/feature-knowledge-system/KNOWLEDGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ directories:
- commands/_partials
- scripts/build-mds.ts
created: 2026-06-21
updated: 2026-07-01
updated: 2026-07-15
---

# Feature Knowledge Base System
Expand All @@ -21,7 +21,7 @@ updated: 2026-07-01
The Feature Knowledge Base System uses a **write-through** model. Knowledge is authored
in-command (at workflow end) by a simplified Knowledge agent that writes directly to
`.devflow/features/{slug}/KNOWLEDGE.md` and updates the `index.md` cache line. There is
no background refresh pipeline, no SessionEnd hook, no Dream task, and no deterministic
no background refresh pipeline, no SessionEnd hook, no Learning task, and no deterministic
CJS engine.

**Source of truth = `KNOWLEDGE.md` frontmatter.** The `index.md` is a regenerable cache:
Expand All @@ -40,15 +40,15 @@ team opts back out by re-adding `.devflow/features/` to their own `.gitignore`.
requiring them to explore from scratch each session.

**Role in larger system**: One of two persistence layers under `.devflow/` (alongside the
Decisions pipeline). Knowledge is NOT a Dream task — it is written in-command. Working
Decisions pipeline). Knowledge is NOT a Learning task — it is written in-command. Working
memory is handled by the background-memory-update worker.

**External dependencies**: MDS compiler (`@mdscript/mds`) at build time to compile the
knowledge partials; `claude` agent at runtime (the Knowledge agent, model=sonnet) to write
KNOWLEDGE.md.

**Toggle**: `devflow knowledge --enable/--disable/--status` or `devflow init --knowledge/--no-knowledge`.
Feature state lives in `.devflow/dream/config.json` (field `knowledge`, default `true`).
Feature state lives in `.devflow/config.json` (field `knowledge`, default `true`; see `src/cli/utils/feature-config.ts`).
Gates write-back ONLY — load is ungated (harmless). No sentinel file.

## Component Architecture
Expand All @@ -63,7 +63,7 @@ Gates write-back ONLY — load is ungated (harmless). No sentinel file.
| Author skill | `shared/skills/feature-knowledge/SKILL.md` | 4-phase authoring + KNOWLEDGE.md template + index.md registration |
| Consumption skill | `shared/skills/apply-feature-knowledge/SKILL.md` | 3-step algorithm for agents loading FEATURE_KNOWLEDGE |
| CLI list | `src/cli/commands/knowledge/list.ts` | Reads index.md / falls back to frontmatter glob; no external scripts |
| CLI toggle | `src/cli/commands/knowledge/toggle.ts` | Flips `knowledge` key in dream config; no sentinel creation |
| CLI toggle | `src/cli/commands/knowledge/toggle.ts` | Flips `knowledge` key in `.devflow/config.json` via `feature-config.ts`; no sentinel creation |

## Component Interactions

Expand All @@ -87,7 +87,7 @@ Invoked at the start of applicable workflows via `knowledge_load()` MDS call sit

Invoked at the end of applicable workflows via `knowledge_writeback()` MDS call site.

1. **Gate** — if dream config `knowledge` is `false`, skip entirely
1. **Gate** — if `.devflow/config.json` `knowledge` is `false`, skip entirely
2. **Check scope** — if this workflow changed a documented area OR found durable cross-cutting knowledge, proceed
3. **Spawn Knowledge agent** — `Agent(subagent_type="Knowledge")` with WORKTREE_PATH, FEATURE_SLUG, FEATURE_NAME, DIRECTORIES, FILES_CHANGED, DECISIONS_CONTEXT, EXISTING_KB, EXPLORATION_OUTPUTS
4. **Agent writes KNOWLEDGE.md** — directly to `.devflow/features/{slug}/KNOWLEDGE.md`
Expand Down Expand Up @@ -132,7 +132,7 @@ of `knowledge_writeback` for the research workflow.

- **500-line cap**: KNOWLEDGE.md exceeding 500 lines must be split into focused sub-knowledge bases.
- **index.md line format**: `- **{slug}** — {areas} — {Use-when description}` — frontmatter is authoritative if the line format changes.
- **No sentinel gating**: The old `.devflow/features/.disabled` sentinel is gone (clean break). Config-only gate per ADR-001 — the `knowledge` key in `dream/config.json` is the sole toggle.
- **No sentinel gating**: The old `.devflow/features/.disabled` sentinel is gone (clean break). Config-only gate per ADR-001 — the `knowledge` key in `.devflow/config.json` is the sole toggle.
- **No concurrent lock**: `index.md` write-through may clobber concurrent writes, but the frontmatter fallback self-heals. `index.md` is git-tracked (shared), so it can also merge-conflict when two branches add different slugs — resolve by keeping both lines.

## Anti-Patterns
Expand Down Expand Up @@ -167,7 +167,7 @@ path. If it is stale or absent, frontmatter glob is the authoritative fallback.
treat a missing `index.md` as a problem — write-through creates it lazily.

**The knowledge config key is the sole gate**: ADR-001 requires config-only gates. The
`knowledge` key in `dream/config.json` gates write-back. The old sentinel
`knowledge` key in `.devflow/config.json` gates write-back. The old sentinel
(`.devflow/features/.disabled`) is gone via the clean break — no migration removes it
because it was never deployed on this branch.

Expand All @@ -190,10 +190,10 @@ compiled output.
- `shared/skills/feature-knowledge/SKILL.md` — Iron Law, 4-phase authoring, KNOWLEDGE.md template, index.md registration instructions
- `shared/skills/apply-feature-knowledge/SKILL.md` — 3-step consumption algorithm, skip guard, verify-against-code freshness
- `src/cli/commands/knowledge/list.ts` — reads index.md directly or falls back to frontmatter glob; no external scripts
- `src/cli/commands/knowledge/toggle.ts` — flips `knowledge` in dream config; no sentinel creation/deletion
- `src/cli/commands/knowledge/toggle.ts` — flips `knowledge` in `.devflow/config.json` (`feature-config.ts`); no sentinel creation/deletion

## Related

- Working Memory (`.devflow/memory/WORKING-MEMORY.md`, `background-memory-update` worker) — sibling persistence layer; independent toggle.
- Decisions pipeline (`.devflow/decisions/`, `decisions-ledger.jsonl`) — sibling persistence layer; shares Dream marker protocol, independent toggle.
- Decisions pipeline (`.devflow/learning/`, `decisions-ledger.jsonl`) — sibling persistence layer; independent toggle.
- ADR-021 (`.devflow/` local by default) — amended for `features/`: feature knowledge bases are git-tracked and committed by the Knowledge agent. See the carve-out in `scripts/hooks/ensure-root-gitignore` + `ensureDevflowGitignore`.
2 changes: 1 addition & 1 deletion .devflow/features/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- **feature-knowledge-system** — commands/_partials, src/cli/commands/knowledge, shared/skills/feature-knowledge, shared/skills/apply-feature-knowledge, shared/agents/knowledge.md, scripts/build-mds.ts — Use when adding a new knowledge base entry, modifying how knowledge is loaded into agents, changing the write-through save model, extending the CLI knowledge commands, or understanding the MDS knowledge module.
- **dream-capture-system** — scripts/hooks, shared/agents/dream.md, src/cli/commands/decisions.ts, src/cli/utils/decisions-ledger-migration.ts, src/cli/utils/project-paths.ts, commands/_partials — Use when modifying capture hooks (capture-prompt/capture-turn/capture-question), the memory or dream pending-turns queues, the background-memory-update detached worker, the Dream agent (shared/agents/dream.md), the session-start-context dream directive, the dream/decisions config toggles, or the decisions index.md write-time artifact and its consumption via decisions_load(). Keywords: capture-prompt, capture-turn, capture-question, queue-append, pending-turns, memory-worker, background-memory-update, Dream agent, dream directive, DREAM MAINTENANCE, DEVFLOW_BG_UPDATER, dream config, dream-lock, json_extract_cwd_field, dream-cleanup, DREAM_MODEL allowlist, decisions index, index.md.
- **ambient-orchestrator** — scripts/hooks, src/cli/commands/ambient.ts, plugins/devflow-ambient — Use when modifying the ambient mode hooks (preamble, session-start-orchestrator), the orchestrator charter file (including the feature-knowledge operating rule), the git-marker helper, the ambient CLI toggle, or the plan-handoff fast-path. Keywords: ambient, preamble, orchestrator, charter, plan-handoff, session-start-orchestrator, git-marker, DEVFLOW_BG_UPDATER, devflow ambient, UserPromptSubmit, SessionStart, feature-knowledge.
- **dynamic-workflow-engine** — commands/dynamic-build.mds, commands/dynamic-plan.mds, commands/dynamic-tickets.mds, commands/dynamic-wave.mds, commands/dynamic-profile.mds, commands/_partials/_engine.mds, commands/_partials/_wave.mds, plugins/devflow-dynamic/commands, tests/build-mds.test.ts — Use when authoring or modifying the dynamic-* commands (dynamic-build, dynamic-plan, dynamic-tickets, dynamic-wave, dynamic-profile), the shared engine/wave/preamble/factory MDS partials, or the build-mds test suite that pins doctrine literals. Keywords: dynamic-build, dynamic-plan, dynamic-tickets, dynamic-wave, dynamic-profile, Workflow tool, agentType, Gate 1, Gate 2, review loop, wave, tickets→plan→build, MDS, _engine.mds, _wave.mds.
- **resolve-pipeline** — commands/resolve.mds, shared/agents/triager.md, shared/agents/coder.md, plugins/devflow-resolve, commands/code-review.mds — Use when modifying /resolve or /code-review convergence logic, adding or changing Triager disposition rules, adjusting Coder operating modes (issue-fix/validation-fix), touching the resolution-summary.md parser contract, changing the Verification Gate retry loop, or understanding how DIFF_FILES flows from git validate-branch into blast-radius triage. Keywords: resolve, triager, disposition matrix, blast-radius, FIX_NOW, FIX_SEPARATE, TECH_DEBT, FALSE_POSITIVE, BY_DESIGN, ESCALATED, resolution-summary, convergence parser, DIFF_FILES, issue-fix, validation-fix, Verification Gate, manage-debt.
- **installer-shadowing** — src/cli/utils/installer.ts, src/cli/commands/init.ts, src/cli/commands/uninstall.ts, src/cli/commands/rules.ts, src/cli/commands/skills.ts, src/cli/plugins.ts, src/cli/utils/marketplace-cleanup.ts — Use when modifying the install pipeline (installViaFileCopy, installAllRules, InstallReport), adding or changing skill/rule shadow override logic, touching uninstall scope or leftover-warning behavior, or extending the CLI skills/rules management commands. Keywords: installViaFileCopy, installAllRules, InstallReport, RuleInstallOutcome, SkillShadowState, RuleShadowState, shadow, unshadow, validateSkillShadow, validateRuleShadow, seedRuleShadow, prefixSkillName, unprefixSkillName, devflow:, skills, rules, uninstall, EISDIR, computeShadowLeftoverWarnings, ShadowWarning, marketplace-cleanup.
- **learning-capture-system** — scripts/hooks, shared/agents/learning.md, src/cli/commands/learning.ts, src/cli/utils/feature-config.ts, src/cli/utils/learning-tuning-config.ts, src/cli/hud/components/learning-counts.ts, commands/_partials — Use when modifying capture hooks (capture-prompt/capture-turn/capture-question), the learning or memory pending-turns queues, the Learning agent (shared/agents/learning.md), the session-start-context learning directive, the feature-config toggles, the learning tuning config, the decisions content files (decisions.md/pitfalls.md/index.md) or their ledger ops, or the devflow learning CLI. Keywords: capture-prompt, capture-turn, capture-question, queue-append, pending-turns, memory-worker, Learning agent, learning directive, LEARNING MAINTENANCE, DEVFLOW_BG_UPDATER, learning-lock, queue_read_gates, decisions_load, DECISIONS_CONTEXT, feature-config, config.json, learning.json, decisions-ledger, assign-anchor, retire-anchor, render-decisions.
Loading
Loading