docs: fill missing CHANGELOG entries; fix map-release Gate 12 awk bug#324
Conversation
…release CHANGELOG gate awk bug CHANGELOG.md was missing entries for #317, #307, #301/#300, #292/#289, #280, #279, and the Claude-side adversarial review feature (2991e7e) — all landed after v3.20.0 but never documented. Also fix the /map-release skill's Gate 12 completeness check: the awk range pattern /## \[Unreleased\]/,/## \[/ collapses to a single line when start and end match the same line, which they do for the "## [Unreleased]" heading itself (it matches both patterns). This made the gate always report 0 CHANGELOG entries. Switched to an explicit flag-based awk in all three occurrences (count, review display, semver-analysis extraction) and dropped the now-unneeded trailing `sed '$d'`.
📝 WalkthroughWalkthroughFixed a bug in awk extraction logic used across three copies of the map-release SKILL.md files where a range-pattern awk command could collapse when start/end patterns overlapped, replacing it with flag-based state toggling. CHANGELOG.md's Unreleased section was also updated with new entries. ChangesAwk extraction fix across SKILL.md variants
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)Not applicable — changes are limited to shell script logic edits and documentation entries, without multi-component control flow. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/mapify_cli/templates_src/skills/map-release/SKILL.md.jinja`:
- Around line 201-206: The CHANGELOG_ENTRIES calculation in the map-release
SKILL template is adding a redundant fallback that can turn an empty count into
duplicate output. Remove the `|| echo "0"` behavior from the Unreleased-section
counting logic, and either count matching entries directly in `awk` or keep
using `grep -cE` while only suppressing its nonzero exit status so
`CHANGELOG_ENTRIES` stays a single numeric value.
In `@src/mapify_cli/templates/skills/map-release/SKILL.md`:
- Around line 201-206: The CHANGELOG entry count logic in the SKILL.md template
currently appends a fallback that can emit a duplicate zero and break the
numeric check. Update the Unreleased counting flow around CHANGELOG_ENTRIES so
it relies on grep -c alone or uses awk to compute the count without printing an
extra value; keep the existing Unreleased section extraction logic and remove
the fallback that writes another 0.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: be87ecc4-dd0e-4341-8264-2dcc260f36f4
📒 Files selected for processing (4)
.claude/skills/map-release/SKILL.mdCHANGELOG.mdsrc/mapify_cli/templates/skills/map-release/SKILL.mdsrc/mapify_cli/templates_src/skills/map-release/SKILL.md.jinja
| # Count CHANGELOG entries in [Unreleased] section. | ||
| # NOTE: a range-pattern awk (/start/,/end/) collapses to the single | ||
| # matching line when start and end match the SAME line — and "## | ||
| # [Unreleased]" matches both "/## \[Unreleased\]/" and "/## \[/". Use an | ||
| # explicit flag instead so the range spans past the heading line itself. | ||
| CHANGELOG_ENTRIES=$(awk '/^## \[Unreleased\]/{f=1;next} /^## \[/{f=0} f' CHANGELOG.md | grep -cE "^- " || echo "0") |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file='src/mapify_cli/templates_src/skills/map-release/SKILL.md.jinja'
# Show the relevant section with line numbers
sed -n '190,215p' "$file" | cat -n
# Inspect how CHANGELOG_ENTRIES is later used
rg -n "CHANGELOG_ENTRIES|CHANGELOG.md|grep -cE \"^- \"" "$file"Repository: azalio/map-framework
Length of output: 2029
Drop the || echo "0" fallback. grep -c already prints 0; the fallback appends a second 0, so CHANGELOG_ENTRIES can become 0\n0 and break the numeric check. Count directly in awk, or keep grep's output and suppress only its exit status.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/mapify_cli/templates_src/skills/map-release/SKILL.md.jinja` around lines
201 - 206, The CHANGELOG_ENTRIES calculation in the map-release SKILL template
is adding a redundant fallback that can turn an empty count into duplicate
output. Remove the `|| echo "0"` behavior from the Unreleased-section counting
logic, and either count matching entries directly in `awk` or keep using `grep
-cE` while only suppressing its nonzero exit status so `CHANGELOG_ENTRIES` stays
a single numeric value.
| # Count CHANGELOG entries in [Unreleased] section. | ||
| # NOTE: a range-pattern awk (/start/,/end/) collapses to the single | ||
| # matching line when start and end match the SAME line — and "## | ||
| # [Unreleased]" matches both "/## \[Unreleased\]/" and "/## \[/". Use an | ||
| # explicit flag instead so the range spans past the heading line itself. | ||
| CHANGELOG_ENTRIES=$(awk '/^## \[Unreleased\]/{f=1;next} /^## \[/{f=0} f' CHANGELOG.md | grep -cE "^- " || echo "0") |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
sed -n '190,230p' src/mapify_cli/templates/skills/map-release/SKILL.mdRepository: azalio/map-framework
Length of output: 2029
Drop the || echo "0" fallback. grep -c already prints 0 when there are no matches, so the fallback turns that into 0\n0 and can break the later numeric comparison. Count in awk or suppress the exit status without printing another value.
🧰 Tools
🪛 SkillSpector (2.3.7)
[warning] 19: [EA2] Autonomous Decision Making: Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
Remediation: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
(Excessive Agency (EA2))
[error] 1114: [TM1] Tool Parameter Abuse: Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Remediation: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
(Tool Misuse (TM1))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/mapify_cli/templates/skills/map-release/SKILL.md` around lines 201 - 206,
The CHANGELOG entry count logic in the SKILL.md template currently appends a
fallback that can emit a duplicate zero and break the numeric check. Update the
Unreleased counting flow around CHANGELOG_ENTRIES so it relies on grep -c alone
or uses awk to compute the count without printing an extra value; keep the
existing Unreleased section extraction logic and remove the fallback that writes
another 0.
Two framework bugs surfaced and were fixed during /map-release Phase 1 (PR #323, #324): a flaky test from a substring-in-joined-argv check, and an awk two-address range that collapsed to one line because its start/end patterns could co-match. Both are instances of the same root cause -- testing discrete-unit membership on a flattened/implicit proxy instead of the structured representation.
Summary
CHANGELOG.md[Unreleased]was missing entries for workflow-context-injector injects terminal completed MAP state #317, record_test_baseline fail-open on >120s suite: timeout yields empty baseline indistinguishable from clean #307, validate_spec_citations.py rejects bare-filename file:line citations as 'file does not exist', forcing manual full-path rewrites #301/map-plan Step 0: research-agent's compressed summary becomes the discovery artifact, losing the file:line evidence later steps require #300, feat(tokenreport): dashboard, history, estimate, JSON/CSV export modes #292/Token accounting dashboard: visualize per-agent cost, cache-hit ratio, trends over time #289, Scope learned rules by module/path — hierarchical rule loading from agentic engineering model #280, release.yml: auto-create GitHub Release on tag publish (drop manual gh release create) #279, and the Claude-side adversarial review feature (2991e7e) — all landed after v3.20.0 but never documented. Discovered while running/map-release's Gate 12 CHANGELOG-completeness check.awk '/## \[Unreleased\]/,/## \[/'collapses to a single matched line when start and end patterns match the same source line — which they do for the## [Unreleased]heading itself (it matches both/## \[Unreleased\]/and/## \[/). This made the gate always reportCHANGELOG_ENTRIES=0, masking the real gap it was supposed to catch. Replaced with an explicit flag-based awk in all 3 occurrences in the skill (count / review-display / semver-extraction) and dropped the now-unneeded trailingsed '$d'.Test plan
make checkpasses (3236 passed, render-parity clean)git logsincev3.20.0after the fixSummary by CodeRabbit
New Features
Bug Fixes