Skip to content

Commit dc0a257

Browse files
committed
fix: v0.3.0 post-release bugs
1. init: add guideline adopt/migrate/skip flow + compile prompt (was detecting guidelines but not offering to import or compile them) 2. gov:compile: warn when ~/.edikt/VERSION differs from config version (compiled_by stamp showed 0.2.3 when config said 0.3.0) 3. sdlc:review: remove PRINCIPAL prefix from agent output format 4. sdlc:review: output each agent's full findings before consolidation (agents ran in fork so only consolidated summary reached the user)
1 parent 48a5e49 commit dc0a257

3 files changed

Lines changed: 56 additions & 3 deletions

File tree

commands/gov/compile.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ CRITICAL: NEVER write governance files that contain contradictions — detect an
4646

4747
1. Display progress: `Step 1/5: Reading source documents...`
4848

49+
1b. Read the edikt version from `~/.edikt/VERSION`. If this file doesn't exist, fall back to `edikt_version:` in `.edikt/config.yaml`. If BOTH differ (e.g., VERSION says 0.2.3 but config says 0.3.0), warn:
50+
```
51+
⚠ ~/.edikt/VERSION (0.2.3) differs from .edikt/config.yaml edikt_version (0.3.0).
52+
The compiled_by stamp will use ~/.edikt/VERSION. To update, re-run the installer:
53+
curl -fsSL https://raw.githubusercontent.com/diktahq/edikt/main/install.sh | bash
54+
```
55+
Use `~/.edikt/VERSION` as the authoritative version for the `compiled_by` stamp.
56+
4957
2. Read `.edikt/config.yaml`. Resolve paths from the `paths:` section using the Path Defaults in the Reference section.
5058

5159
3. Read source documents:

commands/init.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,49 @@ Choice [1]:
323323

324324
**Critical:** whichever choice is made, the generated `.edikt/config.yaml` MUST reflect the actual location of the ADRs. Never leave the default path in config when ADRs live elsewhere. Otherwise `/edikt:gov:compile` and `/edikt:status` will report zero ADRs despite them existing.
325325

326+
### 2a.2 Detected guidelines — Adopt / Migrate / Skip
327+
328+
**If existing guidelines or convention docs were detected** (e.g., files with naming patterns, coding standards, style guides, best practices — often in `docs/`, `guides/`, `conventions/`, or `standards/`), capture the detected path as `$DETECTED_GUIDELINES_PATH`.
329+
330+
If the detected path differs from edikt's default (`docs/guidelines/`), prompt:
331+
```
332+
Found {n} existing guidelines/conventions in {path}.
333+
334+
How should edikt handle them?
335+
[1] Adopt — keep them at {path} and configure edikt to use that path (default)
336+
[2] Migrate — move them to docs/guidelines/ (edikt's default layout)
337+
[3] Skip — ignore them, don't import
338+
Choice [1]:
339+
```
340+
341+
**If the user chooses [1] Adopt:**
342+
- Write `paths.guidelines: {detected_path}` to `.edikt/config.yaml`
343+
- Do NOT move or copy files
344+
- After: "Configured edikt to use {path} for guidelines. Run `/edikt:guideline:compile` to compile them into governance directives."
345+
346+
**If the user chooses [2] Migrate:**
347+
- Read each guideline file
348+
- Move to `docs/guidelines/`
349+
- If the file doesn't follow guideline format (missing `## Rules` section), convert it: extract rules as MUST/NEVER bullets, add a `## Purpose` section from existing content
350+
- Write `paths.guidelines: docs/guidelines` to config
351+
- After: "Migrated {n} guidelines to docs/guidelines/. Run `/edikt:guideline:compile` to compile them into governance directives."
352+
353+
**If the user chooses [3] Skip:**
354+
- Continue with edikt's default paths
355+
- Remind them they can import later with `/edikt:docs:intake`
356+
357+
**After adoption or migration**, prompt to compile:
358+
```
359+
Would you like to compile these guidelines into governance directives now?
360+
[1] Yes — run /edikt:guideline:compile (recommended)
361+
[2] No — I'll compile later
362+
Choice [1]:
363+
```
364+
365+
If yes, run `/edikt:guideline:compile` to generate sentinel blocks. Then remind: "Run `/edikt:gov:compile` to include these in the governance index."
366+
367+
**Critical:** the generated `.edikt/config.yaml` MUST reflect the actual location of guidelines. Same rule as ADRs — never leave the default path when guidelines live elsewhere.
368+
326369
### 2b. Project Templates (v0.3.0 Adapt mode)
327370

328371
This step runs once per artifact type (ADRs, Invariant Records, guidelines) and generates `.edikt/templates/<artifact>.md` files that future `/edikt:adr:new`, `/edikt:invariant:new`, and `/edikt:guideline:new` commands will use via the lookup chain documented in each `new.md` file.

commands/sdlc/review.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ CRITICAL: NEVER spawn agents for domains not detected from the changed files —
5050
```
5151
If a spec exists, run drift detection using `/edikt:sdlc:drift` logic with `--scope=spec` and append findings under a "DRIFT CHECK" section. If no spec exists, skip silently.
5252

53-
11. Display progress: `Step 3/3: Consolidating findings...`
53+
11. Display progress: `Step 3/3: Collecting and consolidating findings...`
5454

55-
12. Consolidate all agent findings and output using the Output Format in the Reference section.
55+
12. For EACH agent that returned findings, output the agent's FULL findings immediately — not just a summary. Each agent's output must be visible to the user before consolidation. Format each agent's section using the Output Format (agent name, severity counts, numbered findings with file references).
56+
57+
13. After ALL individual agent sections are output, add the consolidated footer with total critical/warning counts across all agents and the action prompt.
5658

5759
## Reference
5860

@@ -163,7 +165,7 @@ Domains: {detected domains}
163165

164166
If a relevant agent is not installed:
165167
```
166-
PRINCIPAL DBA — not installed (run /edikt:agents add dba)
168+
DBA — not installed (run /edikt:agents add dba)
167169
```
168170

169171
### Drift Check Output Format

0 commit comments

Comments
 (0)