Skip to content

Commit d2f9b53

Browse files
committed
fix(levelup): release v1.6.1 β€” repair/validate fixes
1 parent 3e45a8d commit d2f9b53

6 files changed

Lines changed: 57 additions & 10 deletions

File tree

β€ŽFORK.mdβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Use `agentic-sdlc-v<version>` with plus:
3939

4040
| Version | Date | Base Upstream | Changes |
4141
|---------|------|---------------|---------|
42+
| 0.8.12+adlc19 | 2026-05-23 | 0.8.12 | LevelUp extension v1.6.1: Fix redundant ID generation, CDR ref preservation, AGENTS.md grep pattern, validate-directives.sh jq error |
4243
| 0.8.12+adlc18 | 2026-05-23 | 0.8.12 | Fix team-ai-directives reference mode registration in extension registry |
4344
| 0.8.12+adlc17 | 2026-05-22 | 0.8.12 | LevelUp extension v1.6.0: Repair command for CDR.md, .skills.json, and AGENTS.md reindexing |
4445
| 0.8.12+adlc16 | 2026-05-20 | 0.8.12 | Architect extension v2.1.0: Technology neutrality in Functional View, Functional-Development view parity, analyze Pass E.6/E.7 |

β€Žextensions/levelup/CHANGELOG.mdβ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ All notable changes to the LevelUp extension will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.6.1] - 2026-05-23
9+
10+
### Fixed
11+
12+
- **repair.md**: Redundant ID generation fixed - strips context type directory prefix (`rules/`, `personas/`, `examples/`) before generating IDs (e.g., `rules/style-guides/java/google_style_guide.md` now produces `rule-style-guides-java-google_style_guide` instead of `rule-rules-style-guides-java-google_style_guide`)
13+
- **repair.md**: CDR references preserved during repair - orphan files now look up existing CDR.md entries before setting `cdr_ref: null`, preventing CDR reference loss
14+
- **repair.md**: AGENTS.md section check now uses flexible grep (`grep -qiE "##.*CDR\\.md"`) to match both `## CDR.md` and `## Context Directive Records (CDR.md)`
15+
- **validate-directives.sh**: Fixed jq error `Could not open file []` caused by passing JSON string `"[]"` as a filename argument to `jq -s` in line 439; now pipes both inputs via stdin
16+
17+
### Changed
18+
19+
- `extension.yml`: Version bump to 1.6.1
20+
821
## [1.6.0] - 2026-05-22
922

1023
### Added

β€Žextensions/levelup/commands/repair.mdβ€Ž

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ grep -q "^## Structure" "{TEAM_DIRECTIVES}/AGENTS.md"
122122
grep -q "^## Loading Order" "{TEAM_DIRECTIVES}/AGENTS.md"
123123
grep -q "^## Functional Categories" "{TEAM_DIRECTIVES}/AGENTS.md"
124124
grep -q "^## Using Skills" "{TEAM_DIRECTIVES}/AGENTS.md"
125-
grep -q "^## CDR.md" "{TEAM_DIRECTIVES}/AGENTS.md"
125+
grep -qiE "##.*CDR\.md" "{TEAM_DIRECTIVES}/AGENTS.md"
126126
```
127127

128128
#### Step 3: Auto-Repair
@@ -197,20 +197,52 @@ Extraction logic:
197197
3. Parse YAML between `---` markers
198198
4. Extract: `id`, `cdr_ref`, `created`, `modified`, `verified`, `age_days`
199199

200+
#### Step 2a: Build CDR Lookup from Existing CDR.md
201+
202+
Before generating new frontmatter, read the existing CDR.md to find pre-existing CDR references for orphan files.
203+
204+
Parse the CDR.md index table to build a mapping of `{relative_file_path β†’ cdr_ref}`:
205+
206+
```bash
207+
# Read existing CDR.md and extract file path -> CDR reference mappings
208+
CDR_LOOKUP=()
209+
if [[ -f "{TEAM_DIRECTIVES}/CDR.md" ]]; then
210+
while IFS='|' read -r _ id module _ _ _ _; do
211+
id="${id// /}"
212+
module="${module// /}"
213+
if [[ -n "$id" && -n "$module" && "$id" =~ ^CDR- ]]; then
214+
CDR_LOOKUP["$module"]="$id"
215+
fi
216+
done < <(grep "| CDR-" "{TEAM_DIRECTIVES}/CDR.md")
217+
fi
218+
```
219+
220+
This creates an associative array:
221+
```
222+
context_modules/rules/style-guides/java/google_style_guide.md β†’ CDR-2026-023
223+
```
224+
200225
#### Step 3: Detect Orphans (No Frontmatter)
201226

202227
Files with `.md` extension but no YAML frontmatter.
203228

204229
For each orphan:
205-
1. Generate `id` from filename: `rules/python/new-pattern.md` β†’ `rule-python-new-pattern`
230+
1. Generate `id` from filename:
231+
- Strip the context type directory prefix (`rules/`, `personas/`, `examples/`)
232+
- Remove `.md` extension, replace `/` with `-`, prepend type prefix
233+
- Example: `rules/python/new-pattern.md` β†’ strip `rules/` β†’ `python/new-pattern.md` β†’ `rule-python-new-pattern`
234+
- Example: `personas/architect.md` β†’ strip `personas/` β†’ `architect.md` β†’ `persona-architect`
206235
2. Determine context type from path:
207236
- `rules/` β†’ `Rule`
208237
- `personas/` β†’ `Persona`
209238
- `examples/` β†’ `Example`
210-
3. Set default metadata:
239+
3. Compute the file's relative path from `TEAM_DIRECTIVES` (e.g., `context_modules/rules/style-guides/java/google_style_guide.md`) and look it up in `CDR_LOOKUP`:
240+
- If found, use the existing `cdr_ref` (e.g., `CDR-2026-023`)
241+
- If not found, set `cdr_ref: null`
242+
4. Set default metadata:
211243
```yaml
212244
id: {generated-id}
213-
cdr_ref: null
245+
cdr_ref: {from CDR_LOOKUP or null} # Preserve existing CDR ref if available
214246
created: {today}
215247
modified: {today}
216248
verified: {today}
@@ -222,9 +254,10 @@ If `--dry-run`:
222254
```markdown
223255
### Orphan Files Detected
224256
225-
| File | Generated ID | Action |
226-
|------|--------------|--------|
227-
| rules/python/new-pattern.md | rule-python-new-pattern | Would add frontmatter |
257+
| File | Generated ID | Existing CDR Ref | Action |
258+
|------|--------------|-----------------|--------|
259+
| rules/python/new-pattern.md | rule-python-new-pattern | CDR-2026-023 | Would add frontmatter (preserving CDR ref) |
260+
| personas/architect.md | persona-architect | null | Would add frontmatter |
228261
```
229262

230263
Otherwise, auto-fix:

β€Žextensions/levelup/extension.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ schema_version: "1.0"
33
extension:
44
id: "levelup"
55
name: "LevelUp - Team AI Directives Contributor"
6-
version: "1.6.0"
6+
version: "1.6.1"
77
description: "Discover and contribute context modules to team-ai-directives using CDRs. Features multi-agent sub-system analysis with cross-system pattern detection, inconsistency tracking, signal gate filtering, verification metadata, and freshness tracking."
88
author: "Agentic SDLC Team"
99
repository: "https://github.com/tikalk/agentic-sdlc-spec-kit"

β€Žextensions/levelup/scripts/bash/validate-directives.shβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ main() {
436436
constitution_conflicts=$(check_constitution_conflicts "$rules_json" "$constitution_json")
437437

438438
local all_conflicts="[]"
439-
all_conflicts=$(echo "$conflicts" | jq -s '.[0] + .[1]' "$constitution_conflicts")
439+
all_conflicts=$(echo "$conflicts $constitution_conflicts" | jq -s 'add')
440440

441441
local filtered_conflicts
442442
filtered_conflicts=$(filter_by_severity "$all_conflicts")

β€Žpyproject.tomlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "agentic-sdlc-specify-cli"
3-
version = "0.8.12+adlc18"
3+
version = "0.8.12+adlc19"
44
description = "Specify CLI (tikalk fork). Agentic SDLC toolkit for Spec-Driven Development with pre-installed extensions and AI integrations."
55
requires-python = ">=3.11"
66
dependencies = [

0 commit comments

Comments
Β (0)