|
| 1 | +--- |
| 2 | +intent: methodology-evolution |
| 3 | +created: 2026-03-05 |
| 4 | +status: active |
| 5 | +--- |
| 6 | + |
| 7 | +# Discovery Log: Methodology Evolution |
| 8 | + |
| 9 | +Elaboration findings persisted during Phase 2.5 domain discovery. |
| 10 | +Builders: read section headers for an overview, then dive into specific sections as needed. |
| 11 | + |
| 12 | + |
| 13 | +## Paper Analysis: ai-dlc-2026.md |
| 14 | + |
| 15 | +**Discovered:** 2026-03-05 |
| 16 | + |
| 17 | +### Current Phase Structure |
| 18 | +1. **Inception** (Mob Elaboration) — Intent → Units → Completion Criteria → Bolt planning |
| 19 | +2. **Construction** (Bolts) — Execute Units via HITL/OHOTL/AHOTL modes, iterate until criteria met |
| 20 | +3. **Operations** — Deploy, monitor, autonomous response within runbook boundaries |
| 21 | + |
| 22 | +### Terminology That Must Evolve |
| 23 | +| Current (Software) | Needed (Domain-Agnostic) | |
| 24 | +|---|---| |
| 25 | +| Builder (hat) | Executor / Implementer | |
| 26 | +| Construction (phase) | Execution | |
| 27 | +| Code, codebase | Artifacts, Deliverables | |
| 28 | +| Tests, lint, typecheck | Verification gates, Quality checks | |
| 29 | +| Deployment | Release, Operationalization | |
| 30 | +| Backpressure | Quality enforcement | |
| 31 | +| Commit, branch, PR | Checkpoint, version, review | |
| 32 | + |
| 33 | +### What's Missing |
| 34 | +- NO Reflection phase — no structured learning loop |
| 35 | +- NO post-deployment review ritual |
| 36 | +- NO outcome assessment ("did the Intent achieve its goal?") |
| 37 | +- NO organizational learning capture |
| 38 | +- Operations outputs are undefined (Inception and Construction have clear artifacts) |
| 39 | +- Operations section ends at paper line 1052 with no closure ritual |
| 40 | + |
| 41 | +### What's Already Domain-Agnostic |
| 42 | +- The core flow (Intent → Units → Bolts → Checkpoints) is conceptually universal |
| 43 | +- Operating modes (HITL/OHOTL/AHOTL) apply to any human-AI collaboration |
| 44 | +- The "collapse" of traditional phases is a universal principle |
| 45 | +- Completion criteria as a concept work for any domain |
| 46 | + |
| 47 | +### Key Paper Sections for Evolution |
| 48 | +- Phase definitions: lines 824-1000 |
| 49 | +- Operating modes: lines 156-246 |
| 50 | +- Lifecycle flow/diagram: lines 1056-1088 |
| 51 | +- Glossary: lines 1390-1410 |
| 52 | +- Operations: lines 1002-1052 |
| 53 | + |
| 54 | + |
| 55 | +## Plugin Architecture: Core Structure |
| 56 | + |
| 57 | +**Discovered:** 2026-03-05 |
| 58 | + |
| 59 | +### Stats |
| 60 | +- 14 hats, 17 skills, 4 workflows |
| 61 | +- Plugin version: 1.20.6 |
| 62 | +- Architecture: Hook-based events + han keep state + git worktrees |
| 63 | + |
| 64 | +### Git Dependency Map (PERVASIVE) |
| 65 | +- **Worktree isolation**: Intent and unit worktrees for parallel work |
| 66 | +- **Branch state**: `han keep` stores iteration.json, scratchpad, blockers on git branches |
| 67 | +- **Branch discovery**: `dag.sh` scans `ai-dlc/*` branches for intents |
| 68 | +- **Remote sync**: Push/pull/upstream tracking in construct skill |
| 69 | +- **Merge strategies**: Unit branches merge to default or intent branch |
| 70 | +- **PR creation**: `gh pr create` in advance skill |
| 71 | +- **VCS abstraction exists** in config.sh (detects jj vs git) but ONLY git is implemented |
| 72 | + |
| 73 | +### Lifecycle (Currently) |
| 74 | +1. `/elaborate` → Write intent.md + unit-*.md to intent worktree |
| 75 | +2. `/construct` → DAG-driven loop: planner → builder → reviewer per unit |
| 76 | +3. Integrator validates all units → mark intent complete → PR/MR |
| 77 | +4. **STOP** — no operation, monitoring, or reflection |
| 78 | + |
| 79 | +### State Storage |
| 80 | +- `iteration.json` (han keep on intent branch): hat, status, workflow, unitStates |
| 81 | +- `scratchpad.md` (han keep on unit branch): progress notes |
| 82 | +- `blockers.md` (han keep on unit branch): blocker context |
| 83 | +- `current-plan.md` (han keep on unit branch): planner output |
| 84 | +- Filesystem: intent.md + unit-*.md frontmatter (committed to git) |
| 85 | + |
| 86 | +### Quality Gates (Backpressure) |
| 87 | +- Autonomous: tests, typecheck, lint, build, security scan |
| 88 | +- Enforced via han-plugin.yml Stop hooks |
| 89 | +- Builder hat must run checks after every change |
| 90 | +- Reviewer validates criteria, not code quality (gates already passed) |
| 91 | + |
| 92 | +### Hats: Domain Analysis |
| 93 | +- **Domain-agnostic (11/14)**: planner, builder, reviewer, integrator, red-team, blue-team, observer, hypothesizer, experimenter, analyst, test-writer |
| 94 | +- **Software-specific (3/14)**: designer (UI/UX), implementer, refactorer |
| 95 | +- Builder hat has discipline-awareness (frontend/backend/docs → different agent types) |
| 96 | + |
| 97 | +### Workflows |
| 98 | +- `default`: planner → builder → reviewer |
| 99 | +- `adversarial`: planner → builder → red-team → blue-team → reviewer |
| 100 | +- `design`: planner → designer → reviewer |
| 101 | +- `hypothesis`: observer → hypothesizer → experimenter → analyst |
| 102 | + |
| 103 | + |
| 104 | +## Config & Settings: Infrastructure Analysis |
| 105 | + |
| 106 | +**Discovered:** 2026-03-05 |
| 107 | + |
| 108 | +### Settings Schema |
| 109 | +- Location: `plugin/schemas/settings.schema.json` |
| 110 | +- Sections: VCS strategy (git/jj), Providers, Mockup format |
| 111 | +- Config precedence: intent frontmatter > repo settings > built-in defaults |
| 112 | + |
| 113 | +### Provider System (4 categories) |
| 114 | +- **Ticketing**: Jira, Linear, GitHub Issues, GitLab Issues |
| 115 | +- **Spec**: Notion, Confluence, Google Docs |
| 116 | +- **Design**: Figma |
| 117 | +- **Comms**: Slack, Teams, Discord |
| 118 | +- Each has a JSON schema, instruction file, and 3-tier loading (built-in → inline → project override) |
| 119 | + |
| 120 | +### State Persistence (han keep) |
| 121 | +- Branch-scoped: intent state on intent branch, unit state on unit branch |
| 122 | +- Keys: iteration.json, scratchpad.md, blockers.md, current-plan.md, next-prompt.md |
| 123 | +- Cross-branch access via --branch flag |
| 124 | +- **Entirely git-dependent** — no fallback for non-git environments |
| 125 | + |
| 126 | +### DAG System (dag.sh, 704 lines) |
| 127 | +- Declarative dependencies in unit frontmatter `depends_on:` |
| 128 | +- Functions: find_ready_units, find_blocked_units, are_deps_completed |
| 129 | +- Fast YAML extraction (no subprocess overhead) |
| 130 | +- Status flow: pending → in_progress → completed (or blocked) |
| 131 | + |
| 132 | +### Hook System (4 hooks) |
| 133 | +- SessionStart: inject-context.sh (652 lines) — loads state, displays context |
| 134 | +- SubagentPrompt: subagent-context.sh (300 lines) — scopes context for subagents |
| 135 | +- PreToolUse: redirect-plan-mode.sh — intercepts /plan → /elaborate |
| 136 | +- Stop: enforce-iteration.sh — checks if work remains, prompts /construct |
| 137 | + |
| 138 | +### Key Infrastructure Files |
| 139 | +| File | Lines | Purpose | |
| 140 | +|---|---|---| |
| 141 | +| plugin/lib/config.sh | 559 | Config loading, VCS detection, provider system | |
| 142 | +| plugin/lib/dag.sh | 704 | DAG resolution, unit status tracking | |
| 143 | +| plugin/hooks/inject-context.sh | 652 | SessionStart context injection | |
| 144 | +| plugin/hooks/subagent-context.sh | 300 | Subagent context scoping | |
| 145 | +| plugin/skills/construct/SKILL.md | 1117 | Core construction loop | |
| 146 | +| plugin/skills/elaborate/SKILL.md | ~900 | Mob elaboration workflow | |
| 147 | +| plugin/skills/advance/SKILL.md | ~150 | Hat progression + merge | |
| 148 | + |
| 149 | +### What Must Change for Git-Optional |
| 150 | +1. han keep needs a file-based fallback (folder mode) |
| 151 | +2. Worktree isolation needs folder-based alternative (subdirectories?) |
| 152 | +3. Branch discovery (dag.sh) needs filesystem-only mode |
| 153 | +4. Remote sync (push/pull) must be optional |
| 154 | +5. PR/MR creation must be optional |
| 155 | +6. Config detection must work without .git directory |
| 156 | + |
0 commit comments