Commit graph

382 commits

Author SHA1 Message Date
Kjell Tore Guttormsen
1d4ade4191 feat(ultraplan-local): add /ultrareview-local to session-title COMMANDS map 2026-05-01 16:43:32 +02:00
Kjell Tore Guttormsen
ebeae010c1 feat(ultraplan-local): extend project-discovery with review.md 2026-05-01 16:43:08 +02:00
Kjell Tore Guttormsen
535dce87dc feat(ultraplan-local): add ultrareview to arg-parser FLAG_SCHEMA 2026-05-01 16:42:01 +02:00
Kjell Tore Guttormsen
1c22452e81 feat(ultraplan-local): extend brief-validator to accept type:ultrareview 2026-05-01 13:31:39 +02:00
Kjell Tore Guttormsen
f6e61e92cd feat(ultraplan-local): add lib/validators/review-validator.mjs 2026-05-01 13:30:43 +02:00
Kjell Tore Guttormsen
e0bf75e17a feat(ultraplan-local): add templates/ultrareview-template.md 2026-05-01 13:29:52 +02:00
Kjell Tore Guttormsen
cf56fbbe27 feat(ultraplan-local): add lib/parsers/jaccard.mjs 2026-05-01 13:28:44 +02:00
Kjell Tore Guttormsen
38b801f534 feat(ultraplan-local): add lib/parsers/finding-id.mjs (stable SHA1) 2026-05-01 13:28:05 +02:00
Kjell Tore Guttormsen
e4b23dc735 feat(ultraplan-local): add lib/review/rule-catalogue.mjs (12 rule keys) 2026-05-01 13:27:29 +02:00
Kjell Tore Guttormsen
b3a91176ab revert(ultraplan-local): untrack ultracontinue-brief + design-notes (local-only)
These were committed in b37b938 by mistake — KTG's convention is that
planning docs in plugins/ultraplan-local/docs/ are local working files
and never pushed to the public marketplace.

- git rm --cached on both files (kept on disk, just untracked)
- .gitignore extended with explicit entries for the two filenames

Existing tracked docs in plugins/ultraplan-local/docs/ predate this rule
and are left alone (separate decision).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 10:07:51 +02:00
Kjell Tore Guttormsen
b37b9383e9 docs(ultraplan-local): /ultracontinue design brief + companion design notes
Adds two sibling files in plugins/ultraplan-local/docs/ that together
specify a new /ultracontinue command for zero-friction multi-session
resumption — drafted from design dialogue at the end of the config-audit
v5.0.0 release session (5 sessions, ~10 manual NEXT-SESSION-PROMPT
context-handovers — friction this work removes).

ultracontinue-brief.md (159 lines):
- Follows the /ultrabrief-local template (frontmatter brief_version: 2.0)
  so /ultraplan-local can consume it directly
- Defines per-project state-file convention .claude/projects/<project>/
  .session-state.local.json as the contract; /ultracontinue is read-only,
  multiple writers may update
- 10 falsifiable success criteria including cross-project consistency,
  no-new-deps, validator + helper command, docs sweep across plugin
  README + CLAUDE.md + marketplace root README
- 3 research topics: ultraexecute end-of-session integration depth,
  graceful-handoff alignment (no hard dep), Claude Code slash-command
  conventions for read+execute commands
- Explicit non-goals: not replacing /ultraexecute-local --resume, not
  replacing graceful-handoff, not auto-orchestrating N sessions
- Open questions and assumptions flagged for plan-critic / scope-guardian

ultracontinue-design-notes.md (117 lines):
- Captures the dialogue rationale that shaped the brief, so the
  implementing session has full context without needing to read this
  conversation's transcript
- Origin (config-audit v5 release pain point), key design insight
  ("state-fil ER kontrakten, ikke verktøyet"), 6 design decisions with
  alternatives considered, anti-patterns from KTG auto-memory to respect,
  recommended reading order, expected scope (1-2 execution sessions)

No code changes. Brief is ready for /ultraplan-local --brief
plugins/ultraplan-local/docs/ultracontinue-brief.md (light path) or
/ultraresearch-local for full research path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 10:05:44 +02:00
Kjell Tore Guttormsen
395a9bd947 docs(config-audit): v5 implementation log — Session 5 release result
v5.0.0 SHIPPED 2026-05-01. Tag config-audit/v5.0.0 pushed to Forgejo.
SC-6b release-gate PASS at -0.85% delta (CLAUDE.md actual 589 vs
estimated 594, well within ±5% gate).

Per-step:
- Step 28: README/CLAUDE.md straggler-sweep + self-audit counter alignment
- Step 29: version bump 4.0.0 → 5.0.0 + consolidated CHANGELOG
- Step 30: full audit + live SC-6b gate + tag (incl. one in-step bug fix
  for hotspot.path exposure, required to make calibration measurable)

635 tests still green throughout. No blockers carried forward.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 09:48:40 +02:00
Kjell Tore Guttormsen
6cfca82885 fix(config-audit): expose hotspot.path for --accurate-tokens calibration + SC-6b PASS
The v5.0.0-rc.1 N5 implementation looked up hotspot.path in
calibrateAgainstApi() but token-hotspots.mjs only emitted hotspot.source —
calibration silently produced 0 actual_tokens because every iteration hit
the `if (!hotspot?.path) continue` guard.

Fix: file-backed hotspots now expose `path: h.absPath` in the JSON output.
MCP-server hotspots intentionally leave path unset — their tokens are
runtime tool-schema (formula-based: 500 + toolCount × 200), not file
content readable by count_tokens.

SC-6b release-gate verified against tests/fixtures/marketplace-large:
- Actual (count_tokens, claude-opus-4-7): 589 tokens for CLAUDE.md
- Estimated (4-bytes/token byte heuristic): 594 tokens
- Delta: -5 tokens / -0.85% — well within ±5% gate. PASS.

CHANGELOG: documented the fix + SC-6b result inline under [5.0.0].

All 635 tests still green. No estimateTokens tuning required for v5.0.0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 09:45:56 +02:00
Kjell Tore Guttormsen
dcf8087972 chore(config-audit): bump version to 5.0.0
- .claude-plugin/plugin.json: 4.0.0 → 5.0.0
- README.md: version badge bump + v5.0.0 row in Version History
- CHANGELOG.md: consolidated `## [5.0.0]` entry covering alpha.1, alpha.2,
  beta.1, rc.1 — Summary, Added, Changed, Removed, Breaking changes,
  Migration notes, Tests, Notes (incl. SC-6b deferred-to-implementation-log)
- root README.md: Config-Audit row v4.0.0 → v5.0.0; counts updated
  (8→12 scanners, 17→18 commands, 543→635 tests, 4→6 patterns,
  +manifest command, +--accurate-tokens, +CPS/DIS/COL coverage)

No code changes in this commit.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 09:39:08 +02:00
Kjell Tore Guttormsen
5bf500e1a8 docs(config-audit): straggler sweep for v5.0.0 — sync all badge counts
Reconcile README/CLAUDE.md/commands/agents to filesystem truth ahead of v5.0.0
release. Self-audit --check-readme now passes (counts: scanners 12, commands 18,
tests 635, knowledge 8, agents 6, hooks 4).

Self-audit (scanners/self-audit.mjs):
- Exclude plugin-health-scanner.mjs from countScannerShape (it is a "standalone"
  scanner per README/CLAUDE.md taxonomy; orchestrated scanners stay at 12)
- countTestCases: spawn `node --test` and parse the `tests N` line so the badge
  reflects test cases (635), not test files (36). countTestFiles kept as
  fallback when subprocess fails.

README.md:
- Badges: scanners 9→12, commands 17→18, tests 543→635
- Body counts updated: 8 quality scanners → 12 deterministic scanners; 8 quality
  areas → 10 (incl. Plugin Hygiene from N6); 9 Node.js scanners → 12
- Scanner table extended with CPS / DIS / COL rows; TOK row reflects the v5
  Pattern E/F/N1 expansion (sonnet-era removed)
- CLI table adds manifest, whats-active, --accurate-tokens, --with-telemetry-recipe
- Knowledge table adds opus-4.7-patterns.md and cache-telemetry-recipe.md
- Scanner Lib table notes WEIGHTS export, severity-weighted scoring, tokenizer-api
- Action Engines table adds manifest.mjs, whats-active.mjs, token-hotspots-cli.mjs
- Test count text 486→635, file count 27→36 (12 lib + 23 scanner + 1 hook)
- Tokens command: 4-pattern phrasing → 6 patterns + --accurate-tokens
- Adds /config-audit manifest and /config-audit whats-active to command tables

CLAUDE.md:
- Posture row: 8 → 10 quality areas
- Tokens row: 4 patterns (incl. sonnet-era) → 6 patterns + --accurate-tokens
- Adds /config-audit manifest entry
- Scanner table: TOK description rewritten; CPS, DIS, COL rows added
- Scanner Lib table: tokenizer-api.mjs added; v5 annotations on severity, output,
  scoring, active-config-reader
- Action Engines table: manifest.mjs added; token-hotspots-cli.mjs flags expanded
- Knowledge table: cache-telemetry-recipe.md added; configuration-best-practices
  notes Opus-4.7 cache-stability rewrite
- Finding ID examples extended with CA-TOK-005, CA-CPS-001, CA-DIS-001, CA-COL-001
- Test count text 543→635, file count 31→36

commands/help.md: tokens/manifest added to Core
commands/posture.md: 8 → 10 quality areas
commands/config-audit.md: argument-hint adds tokens/manifest; router adds tokens
  and manifest; "Running 8 configuration scanners" → 12
agents/feature-gap-agent.md: 8 → 10 quality areas

No production code paths changed beyond self-audit's badge-counting heuristic.
All 635 tests still green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 09:34:43 +02:00
Kjell Tore Guttormsen
17af3d55f6 docs(config-audit): v5 implementation log — Session 4 rc.1 result 2026-05-01 09:19:04 +02:00
Kjell Tore Guttormsen
1ce26fea41 docs(config-audit): CHANGELOG 5.0.0-rc.1 entry 2026-05-01 09:15:52 +02:00
Kjell Tore Guttormsen
b7414303de feat(config-audit): --accurate-tokens API calibration (v5 N5) [skip-docs] 2026-05-01 09:15:02 +02:00
Kjell Tore Guttormsen
1d12231748 docs(graceful-handoff): align README with marketplace standard
Plugin README rewritten from 187 to 354 lines in the same shape as
ai-psychosis, llm-security, config-audit, and ms-ai-architect:

- English (other plugin READMEs are English)
- Standard solo-project + AI-generated disclaimers
- Badges row (version, platform, skill/hooks/pipeline counts, tests, license)
- Table of Contents
- Mermaid architecture diagram (detection / pipeline / resumption / manual)
- 4-step context resolution table (v2.1)
- Components section (skill, pipeline, hooks)
- Workflow examples + safety guarantees + limitations
- Inline version history + Feedback & Contributing

Root README graceful-handoff card updated to reflect v2.1 model-aware
detection and 57-test count (was 36).
2026-05-01 09:14:10 +02:00
Kjell Tore Guttormsen
df6e012903 docs(config-audit): cache-telemetry recipe + --with-telemetry-recipe flag (v5 M7) 2026-05-01 09:12:17 +02:00
Kjell Tore Guttormsen
e1e23edbcd docs(config-audit): knowledge rensing — Opus 4.7 cache-stability guidance (v5 M8) 2026-05-01 09:10:32 +02:00
Kjell Tore Guttormsen
40a82ccdb4 fix(graceful-handoff): model-aware context window detection (v2.1.0)
Stop hook fallback antok 200K-vindu. På Opus 4.7 (faktisk 1M) kunne
auto-handoff fyre 5–7x for tidlig — estimert 70% når reell bruk var
~14%. Erstatter enkel fallback med 4-stegs resolution-kjede:

  1. payload.context_window.used_percentage  (autoritativ)
  2. payload.context_window.context_window_size + transcript-estimat
  3. MODEL_WINDOWS[payload.model.id] + estimat
  4. FALLBACK_WINDOW=1_000_000 + estimat (2026-default)

additionalContext-meldinger inkluderer nå [kilde: <source>] for innsyn.
Brief som kilde-artefakt i docs/brief-context-window-detection.md.
6 nye tester (57 totalt). Ingen regresjoner.
2026-05-01 09:08:24 +02:00
Kjell Tore Guttormsen
346b4c4fb7 docs(config-audit): v5 implementation log — Session 3 beta.1 result
Session 3 (beta.1) shipped 7 steps in one session: N1 (CA-TOK-005),
N2 (manifest CLI), N3 (CPS), N4 (DIS), N6 (COL) + namespace research
spike + CHANGELOG entry. 586 → 625 tests, all green.

Per-step result table + notable observations and deviations recorded.
No blockers carried into Session 4.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 07:50:22 +02:00
Kjell Tore Guttormsen
5a1e7cb510 docs(config-audit): CHANGELOG 5.0.0-beta.1 + N1 breaking note
beta.1 wrap entry covering N1-N4 + N6 (Steps 18-22b). Includes
explicit Known breaking changes section on CA-TOK-* glob suppression
matching CA-TOK-005, and notes plugin-vs-built-in collision is
deferred to v5.0.1.

Tests: 586 → 625 (+39).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 07:47:12 +02:00
Kjell Tore Guttormsen
cd25c1e934 feat(config-audit): cross-plugin collision scanner COL (v5 N6) [skip-docs]
New COL scanner detects skill-name collisions across plugins and
between user-level skills (~/.claude/skills/) and plugin-bundled
skills. Skill identity is the directory basename — matches how
enumerateSkills resolves names.

Detection rules (per docs/v5-namespace-research.md, confidence: medium):
- Plugin-vs-plugin same skill name → severity low (CA-COL-001)
- User-vs-plugin same skill name → severity medium (CA-COL-001)
- Plugin-vs-built-in collisions: out of scope for v5.0.0 (insufficient
  verification — recorded for v5.0.1 follow-up).

Findings carry details.namespaces array with {source, name, path} for
every conflicting source — supports per-collision reporting downstream.

output.mjs: finding() helper now passes through optional `details`
field (scanner-specific structured payload).

scoring.mjs: COL → "Plugin Hygiene" (new area, 10 total). Posture test
updated from 9 → 10 area scores.

.gitignore: docs/v5-namespace-research.md is local-only (Step 22a
research output, gitignored per plan).

Fixture collision-plugins/fake-home/ has user skill `review` colliding
with plugin-a + plugin-b's `review` (medium severity), plus plugin-c's
unique `summarize` (no collision).

[skip-docs] reason: v5 plan fences off README/CLAUDE.md badge updates
to Session 5; Forgejo pre-commit-docs-gate hook requires this tag.

Tests: 617 → 625 (+8).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 07:46:15 +02:00
Kjell Tore Guttormsen
cc349d6fe1 feat(config-audit): disabled-in-schema scanner DIS (v5 N4) [skip-docs]
New DIS scanner detects tools that appear in BOTH permissions.deny
and permissions.allow within the same settings.json file. The deny
list wins, so allow entries are dead config but still load on every
turn and confuse intent.

Tool identity = bare name (everything before "("). `Bash(npm:*)` and
`Bash` are treated as the same tool, so a deny on `Bash` flags any
`Bash(...)` allow entry.

Severity: low. Wired into scan-orchestrator + scoring (area: Settings).
Fixture denied-tools-in-schema has Bash in both arrays; healthy-project
serves as the negative case.

[skip-docs] reason: v5 plan fences off README/CLAUDE.md badge updates
to Session 5; Forgejo pre-commit-docs-gate hook requires this tag.

Tests: 611 → 617 (+6).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 07:39:58 +02:00
Kjell Tore Guttormsen
65087e624f feat(config-audit): cache-prefix stability scanner CPS (v5 N3) [skip-docs]
New CPS scanner walks CLAUDE.md cascade and flags volatile content
between lines 31 and 150 — the cache-prefix window beyond TOK Pattern
A's top-30 territory. Volatile content anywhere in the cached prefix
forces a fresh cache write from that line down on every turn.

Volatile-pattern set extends TOK Pattern A with:
- shell-exec lines (! prefix) — common in CLAUDE.md to inject git/date
- ${VAR} substitutions — vary per-shell, defeat cache reuse

Severity: medium per finding. Skips lines 1-30 to avoid duplicating
Pattern A's range; CPS' value is in the 31-150 zone.

Wired into scan-orchestrator + scoring SCANNER_AREA_MAP. CPS shares
the "Token Efficiency" area with TOK; scoreByArea now deduplicates by
area name and combines counts across scanners contributing to the
same area, so the 9-area scorecard contract holds.

Fixtures volatile-mid-section/{volatile-line-60, volatile-line-200}
verify both positive (line 60) and out-of-window (line 200) cases.

[skip-docs] reason: v5 plan fences off README/CLAUDE.md badge updates
to Session 5; Forgejo pre-commit-docs-gate hook requires this tag.

Tests: 604 → 611 (+7).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 07:37:54 +02:00
Kjell Tore Guttormsen
0420b8cc4a feat(config-audit): /config-audit manifest command (v5 N2) [skip-docs]
New scanners/manifest.mjs CLI + commands/manifest.md slash command.
Reads activeConfig and produces a flat, ranked list of every token
source (CLAUDE.md cascade entries, plugins, skills, MCP servers, hooks)
sorted DESC by estimated_tokens.

CLAUDE.md per-file tokens are derived by distributing
claudeMd.estimatedTokens across the cascade proportional to bytes.

Tests cover both real-config (plugin root) and fixture (rich-repo with
patched HOME containing 2 plugins + 3 skills + .mcp.json) paths, plus
error handling (nonexistent path → exit 3, --output-file).

Builds on readActiveConfig from M1 (v5 alpha.2).

[skip-docs] reason: v5 plan fences off README/CLAUDE.md badge updates
to Session 5; Forgejo pre-commit-docs-gate hook requires this tag on
feat commits without doc changes.

Tests: 593 → 604 (+11).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 07:32:54 +02:00
Kjell Tore Guttormsen
b2407a09b3 feat(config-audit): CA-TOK-005 MCP tool-schema budget (v5 N1) [skip-docs]
Adds detectMcpToolBudget detection block in TOK scanner. Tiered severity
per project-local .mcp.json server based on toolCount:
- < 20: no finding
- 20-49: low
- 50-99: medium
- 100+: high
- null (manifest unparseable): low + "tool count unknown" message

Scoped to source==='.mcp.json' to keep findings actionable for the
audited path; plugin/user-level MCP servers are surfaced by the
manifest scanner (Step 19 / N2).

5 fixtures (mcp-budget/{14,25,60,120,unknown}-tools) use inline `tools`
arrays in .mcp.json — no node_modules needed for these tests.

Tests assert title+severity (not exact ID) since TOK IDs are sequential
per scan, not semantic per pattern.

[skip-docs] reason: v5 plan fences off README/CLAUDE.md badge updates
to Session 5; Forgejo pre-commit-docs-gate hook requires this tag on
feat commits without doc changes.

Tests: 586 → 593 (+7).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 07:29:57 +02:00
Kjell Tore Guttormsen
dd0d4bf738 docs(config-audit): v5 implementation log — Session 2 alpha.2 result 2026-05-01 07:14:18 +02:00
Kjell Tore Guttormsen
55cedbea2c docs(config-audit): CHANGELOG 5.0.0-alpha.2 entry 2026-05-01 07:10:52 +02:00
Kjell Tore Guttormsen
3c79f95e9a feat(config-audit): self-audit --check-readme flag (v5 F6) [skip-docs]
Filesystem counts are the source of truth; README badges parsed via
line-anchored substring (badge/<kind>-<N>-...). Emits readmeCheck object
with counts/badges/mismatches.

CLI: node scanners/self-audit.mjs --check-readme [--json]
API: runSelfAudit({ checkReadme: true }) → result.readmeCheck
Helper: checkReadmeBadges(pluginDir) for per-fixture testing

New fixture: readme-desynced/ (commands/foo + bar, README claims 1).

Note: alpha phase does NOT require result.readmeCheck.passed === true.
Self-test of real plugin currently fails (scanners 10 vs 9, tests 31 vs 543);
will be reconciled in Session 5 Step 28 (README sync).

582 → 586 tests, all green.
2026-05-01 07:09:26 +02:00
Kjell Tore Guttormsen
910567d661 feat(config-audit): HKV flags verbose hook output (v5 M5) [skip-docs]
Static heuristic — counts console.log / process.stdout.write lines per
referenced hook script. > 50 → low CA-HKV-NNN finding.

New fixtures:
- hooks-verbose/ (61 verbose lines → triggers)
- hooks-quiet/ (5 lines → no finding)

580 → 582 tests, all green.
2026-05-01 07:05:45 +02:00
Kjell Tore Guttormsen
7181862644 chore(config-audit): allow fake node_modules in tests/fixtures (v5 M1) [skip-docs]
The mcp-tool-heavy fixture relies on node_modules/mcp-heavy/package.json
being committed so the v5 M1 tool-count detection test runs deterministically.
Add an unignore rule for tests/fixtures/**/node_modules/.
2026-05-01 07:02:54 +02:00
Kjell Tore Guttormsen
1422daf895 feat(config-audit): MCP tool-count detection with manifest fallback (v5 M1) [skip-docs]
readActiveMcpServers now resolves tool count via:
  1. In-config tools array
  2. Cached tools/list at \$HOME/.claude/config-audit/mcp-cache/<name>.json
  3. node_modules/<pkg>/package.json (resolved from npx <pkg>)
  4. Fallback: { toolCount: null, toolCountUnknown: true }

estimateTokens uses detected toolCount (heavy server > light server).

New fixture: mcp-tool-heavy/ with mocked node_modules/mcp-heavy/package.json (20 tools).

576 → 580 tests, all green.
2026-05-01 07:02:08 +02:00
Kjell Tore Guttormsen
9a44df22ac feat(config-audit): TOK flags skill description > 500 chars (v5 M2) [skip-docs]
- New Pattern F in TOK: low-severity finding when SKILL.md description > 500 chars
- Scoped to discovery.files (project-local) — activeConfig.skills walk would
  pull in user/plugin skills out of project scope
- New fixtures: skill-bloated (594-char desc) + skill-tight (46-char baseline)

574 → 576 tests, all green.
2026-05-01 06:58:42 +02:00
Kjell Tore Guttormsen
25ca6139b4 feat(config-audit): TOK flags CLAUDE.md cascade > 10k tokens (v5 M4) [skip-docs]
- New Pattern E in TOK: emits medium finding when activeConfig.claudeMd.estimatedTokens > 10_000
- Uses cascade tokens, file count, and calibration note as evidence
- New fixtures: large-cascade (37k bytes / 14475 cascade tokens) + small-cascade (5k baseline)

572 → 574 tests, all green.
2026-05-01 06:53:12 +02:00
Kjell Tore Guttormsen
9330124f5c feat(config-audit): flag additionalDirectories > 2 (v5 M6) [skip-docs]
- Add 'additionalDirectories' to KNOWN_KEYS
- Emit low severity finding when length > 2
- New fixtures: additional-dirs-many (3 entries) + additional-dirs-ok (2)

569 → 572 tests, all green.
2026-05-01 06:50:24 +02:00
Kjell Tore Guttormsen
58d6b5b9ea feat(config-audit): recalibrate TOK severities for tokens/turn (v5 F7) [skip-docs]
- Pattern A (cache-breaking volatile top): medium → high
- Pattern B (redundant permissions): low → medium
- Pattern C (deep @import chain): medium → low
- Add calibration_note evidence on every TOK finding
- Table-driven severity tests (identify by title, IDs are sequential)

563 → 569 tests, all green. Doc sweep deferred to Session 5 (Step 28).
2026-05-01 06:47:32 +02:00
Kjell Tore Guttormsen
5df8e8888e docs(ultraplan-local): trim README — outcomes section + remove duplication
Add "What you get" with Solo / Team / Virksomhet profiles + honest
"What it doesn't solve" list. Lets adoption decisions land before
command details.

Cuts (deduplication and historical noise):
- Architecture file-tree (~50 lines) → terse top-level layout +
  pointer to CONTRIBUTING.md. Original was stale (missing lib/,
  wrong hook-count, wrong plugin.json version note)
- "How it compares" matrix (~17 lines) — sales-coded comparison
  vs cloud tools, doesn't help adoption decisions
- Per-command "How it works" 8-step prose (~50 lines across 4
  commands) → 2-3 sentence summaries
- Exploration / Review / Research agent tables (~40 lines) →
  one-liner pointers to agents/ directory (already self-documenting)
- v1.x and v2.x migration sections (~30 lines) → pointer to
  CHANGELOG.md / MIGRATION.md
- v3.0.0, v2.4.0 historical callouts (~9 lines) — CHANGELOG owns
  these
- Cost profile bullet-list (~13 lines) → one paragraph

Net: 770 → 609 lines (-21%). Tests green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 06:44:44 +02:00
Kjell Tore Guttormsen
3aba15c566 docs(config-audit): v5 implementation log — Session 1 alpha.1 result
Per-step result table for Steps 1-9 + 8b with commit SHAs and notable
deviations (Step 6 baseline switch to sonnet-era, Step 8 surprise on
sonnet-era discovery scope, PathGuard hook false positive on test
fixtures). 543 → 563 tests, all green, no blockers carried forward.
2026-05-01 06:37:08 +02:00
Kjell Tore Guttormsen
919bd213f8 docs(config-audit): CHANGELOG 5.0.0-alpha.1 entry
Summarizes F1-F5 scope: TOK ↔ readActiveConfig integration, 'mcp' kind
in estimateTokens (15 → ≥500), severity-weighted scoreByArea, dead-code
removal in TOK hotspots, Pattern D / CA-TOK-004 removal.

Includes migration notes for downstream consumers (CA-TOK-* globs still
suppress 001-003; scoringVersion field added for v4→v5 detection).
2026-05-01 06:34:06 +02:00
Kjell Tore Guttormsen
08a9ead51a docs(config-audit): remove CA-TOK-004 references after F5 (v5)
knowledge/opus-4.7-patterns.md:
- Pattern 4 row removed from the catalogue table
- "Pattern 4 (sonnet-era)" detection note removed
- Threshold-calibration note no longer mentions pattern 4
- Added a short pointer explaining the v5 F5 removal

commands/tokens.md:
- "CA-TOK-001..004" → "CA-TOK-001..003" in two places
2026-05-01 06:33:01 +02:00
Kjell Tore Guttormsen
2810ee6f62 feat(config-audit): remove TOK Pattern D detectSonnetEra (v5 F5)
Pattern D was the v4 sonnet-era signature: 'config is structurally
clean but uses no Opus-4.7-specific features'. Two problems:
- It triggered on any minimal config that happened to lack skills/MCP
- The advice was generic and not actionable

The hotspots ranking and per-pattern findings (A/B/C) cover the same
ground with concrete, file-anchored signal. Dropping the noise.

BREAKING (intentional): scanners no longer emit the sonnet-era info
finding. Suppression entries and downstream tooling that reference
the v4 finding ID should be updated. Doc sweep follows in Step 8b.

Tests: sonnet-era fixture now asserts zero findings.
2026-05-01 06:31:43 +02:00
Kjell Tore Guttormsen
1486368a2b chore(release): ultraplan-local v3.1.0
Quality program release. Spor 0+1+2+3 all delivered.

- 109 zero-dep tests gate fork-readiness
- 5 validators wired into 4 commands as CLI shims
- HANDOVER-CONTRACTS.md: single source of truth for 5 pipeline handovers
- PreCompact-hook (P0) closes progress.json drift; --resume now works
- Semantic plan-critic catches paraphrased deferred decisions
- examples/01-add-verbose-flag/: hand-calibrated end-to-end pipeline demo
- 4 hooks total (pre-bash, pre-write, session-title, post-bash-stats, pre-compact-flush)
- SECURITY.md + Extending-the-plugin docs

CC v2.1.x feature adoption: F8 (MCP_CONNECTION_NONBLOCKING),
F9 (sessionTitle), F3 (duration_ms), F12 (disableSkillShellExecution).
F2 (hook 'if'-field) deferred — universal protection wins.

Pre-flight verification:
- npm test → 109 pass
- plan-validator --strict templates/plan-template.md → READY
- plan-validator --strict tests/fixtures/plan-fase-narrative.md → FAIL (expected)
- grep smallCodebase|mediumCodebase|largeCodebase → 0 hits

Version bumped: package.json, plugin.json, README badge, root README,
root CLAUDE.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 06:31:42 +02:00
Kjell Tore Guttormsen
0d8a9af3d6 fix(config-audit): remove TOK dead take + hotspot padding (v5 F4)
The buildHotspots padding loop and unused 'take' variable were dead
code from the v3 hotspots-min contract. Replaced with a clean
ranked.slice(0, HOTSPOTS_MAX). Tiny fixtures may now return fewer
than 3 hotspots, which is the honest answer; the contract now only
asserts <= 10.

Tests: +2 cases — every hotspot.source is unique (no padding); length
never exceeds HOTSPOTS_MAX.
2026-05-01 06:29:33 +02:00
Kjell Tore Guttormsen
9ecd225018 feat(ultraplan-local): Spor 3 — semantic plan-critic, examples, CC features, security docs
- agents/plan-critic.md: rule #7 split into literal blockers (TBD/TODO/FIXME)
  + semantic rubric with 8 deferred-decision tests; calibrated against the
  5-phrase corpus from the v3.1.0 quality brief
- hooks/hooks.json: rebuilt from corrupted state; valid JSON, registers
  PreToolUse(Bash,Write), UserPromptSubmit, PostToolUse(Bash), PreCompact
- hooks/scripts/session-title.mjs: NEW — sets ultra:<cmd>:<slug> session
  title for ultra commands (CC v2.1.94+)
- hooks/scripts/post-bash-stats.mjs: NEW — appends duration_ms per Bash
  call to ultraexecute-stats.jsonl (CC v2.1.97+)
- SECURITY.md: NEW — Forgejo private-issue reporting, supported = current
  minor only, scope = 4 hooks + denylist, hardening recommendations
- docs/architect-bridge-test.md: NEW — manual smoke checklist for the
  ultraplan ↔ ultra-cc-architect bridge
- examples/01-add-verbose-flag/: NEW — calibrated end-to-end (brief +
  research + plan + progress.json) for fork-er onramp; all four artifacts
  pass their validators
- README.md: + Extending the plugin, + Headless multi-session tuning
  (MCP_CONNECTION_NONBLOCKING), + Session titles, + Per-step timing,
  + disableSkillShellExecution recommendation
- CLAUDE.md: documents session-title.mjs and post-bash-stats.mjs
- root README.md: v3.1.0 entry expanded with Spor 2+3 deliverables

CC features adopted: F8, F9, F12 implemented; F3 implemented as Bash
PostToolUse logger; F2 (hook 'if'-field scoping) deferred — universal
protection beats reduced-scope protection for blocked commands.

Tests: 109/109 green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 06:28:44 +02:00
Kjell Tore Guttormsen
34669d596c feat(config-audit): TOK consumes readActiveConfig (v5 F1)
Removes the v4 'void readActiveConfig' placeholder and wires the
active-config snapshot into the TOK scanner.

Per-turn behavior changes:
- Each enabled MCP server becomes its own hotspot entry (richer than
  the parent .mcp.json file alone)
- total_estimated_tokens now includes MCP server cost
- result.activeConfig exposes a small summary
  (claudeMdEstimatedTokens, mcpServerCount, pluginCount, skillCount)

Failures of readActiveConfig are non-fatal — the scanner falls back
to the discovery-only path used in v4.

Tests: +3 cases on the new tok-active-config fixture
(.mcp.json with 2 servers, CLAUDE.md, plugin skeleton).
2026-05-01 06:27:34 +02:00
Kjell Tore Guttormsen
ce7c42f517 fix(config-audit): MCP token callers use 'mcp' kind (v5 F2)
Two MCP enumeration paths in readActiveMcpServers now pass kind='mcp'
to estimateTokens with optional toolCount derived from def.tools array
(populated when callers cache MCP discovery — Step 14 wires that up).

Hook callers keep kind='item' (no schema overhead).

Visible effect: every active MCP server jumps from estimatedTokens=15
to >= 500 (or higher when toolCount is known). The whats-active output
and TOK hotspots now reflect actual MCP cost.

Tests: assert mcpServers[].estimatedTokens >= 500 in fixture.
2026-05-01 06:22:54 +02:00
Kjell Tore Guttormsen
48d560a209 feat(config-audit): add 'mcp' kind to estimateTokens (v5 F2)
Differentiate MCP servers from generic 'item' (flat 15) — they actually
cost 500+ tokens per turn for protocol metadata and tool schemas.

estimateTokens(bytes, 'mcp', {toolCount}) returns max of:
- 500 token floor (base overhead)
- ceil(bytes / 3.5) (json-rate when bytes known)
- 500 + toolCount * 200 (when tool count is detected; Step 14 wires this)

Caller-side migration in next commit (Step 5).

Tests: +4 cases for mcp kind.
2026-05-01 06:21:30 +02:00