Commit graph

473 commits

Author SHA1 Message Date
Kjell Tore Guttormsen
ea715b65de test(ultraplan-local): add SC3(b) source_findings structural test
Synthetic plan.md fixture with source_findings: block-style YAML list of 3
40-char hex IDs in frontmatter, plus minimal plan structure (Title +
Implementation Plan + 1 Step + Manifest). 3 tests verify:

1. plan-validator accepts a plan with source_findings (additive optional field)
2. frontmatter parser extracts source_findings as array of strings
3. each ID matches the 40-char lowercase hex format from finding-id.mjs

Closes the SC3(b) gap flagged by adversarial review (scope-guardian Gap 2).
LLM-level behavior (planner emitting source_findings) remains non-testable
without live invocation; this covers the structural contract.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 17:23:30 +02:00
Kjell Tore Guttormsen
dff278f02a test(humanizer): replace title-string assertions with ID-based checks
Wave 2 / Step 4 of v5.1.0 plain-language UX humanizer rollout. Re-anchors
34 title-string assertions across 4 test files so they survive Wave 3's
title/description/recommendation rewriting at the CLI layer.

Anchoring strategy per scanner:
- GAP findings: scanner + category + recommendation substring (humanizer
  preserves stable identifiers like CLAUDE.md, .mcp.json, hook in rec).
  Hardcoded CA-GAP-NNN IDs for positive checks.
- HKV findings: scanner + evidence regex (evidence preserved verbatim).
- SET findings: scanner + evidence regex (evidence preserved verbatim).
- PLH findings: scanner + hardcoded CA-PLH-NNN IDs (no evidence on most
  PLH findings, so ID is the only stable anchor for specific cases;
  negative checks use scanner + title-substring spanning raw + humanized).

Per docs/v5.1.0-test-audit.md classification: only (b) WILL BREAK
assertions modified. (a) shape-only assertions (error-message formatting,
pure existence checks) untouched. tests/lib/output.test.mjs and
tests/lib/diff-engine.test.mjs and tests/scanners/fix-engine.test.mjs
unchanged (synthetic test inputs, not scanner output).

Test count unchanged: 689/689 pass. IDs harvested via deterministic
runtime dump per fixture (resetCounter + scan).
2026-05-01 17:22:55 +02:00
Kjell Tore Guttormsen
b69fdea883 test(ultraplan-local): add review determinism integration test
3 integration tests using the run-A/run-B fixtures:
- Jaccard(A, B) ≥ 0.70 (SC4 brief threshold)
- IDs match 40-char hex shape (lib/parsers/finding-id.mjs format)
- no duplicate IDs within a single run

Tests the Jaccard PIPELINE; real-LLM determinism deferred to v1.1.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 17:21:42 +02:00
Kjell Tore Guttormsen
5aa37941ed test(ultraplan-local): add synthetic ultrareview determinism fixtures
review-run-A.md (5 findings) and review-run-B.md (6 findings, A ⊂ B) form a
known-Jaccard fixture pair: |A ∩ B| = 5, |A ∪ B| = 6, Jaccard = 5/6 = 0.833,
above the SC4 threshold of 0.70. IDs are real 40-char SHA1s computed via
lib/parsers/finding-id.mjs from realistic (file, line, rule_key) triplets.

Both fixtures pass review-validator --strict (frontmatter + body sections +
findings shape). Real-LLM determinism measurement deferred to v1.1.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 17:21:02 +02:00
Kjell Tore Guttormsen
09e7fb9364 test(ultraplan-local): extend doc-consistency with 4 ultrareview pins
Modify "all four pipeline commands" → "all five" (adds /ultrareview-local).
Add 3 new pins: Handover 6 section in HANDOVER-CONTRACTS.md,
review-validator CLI shim, rule-catalogue 12-key size invariant.

11/11 doc-consistency tests pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 17:18:51 +02:00
Kjell Tore Guttormsen
90d45a5be4 docs(ultraplan-local): document ultrareview-local in plugin + marketplace README
Plugin README: add /ultrareview-local to command tables, division-of-labor,
quick start, and example workflows. New /ultrareview-local section with
modes, output format, triage gate, and Handover 6 feedback loop. Bump
agent count 19 → 23 and command count 4 → 5 in architecture diagram.

Marketplace root README: bump ultraplan-local version 3.1.0 → 3.2.0,
update tagline to "Five-command (brief, research, plan, execute, review)
universal pipeline", add /ultrareview-local bullet, add v3.2.0 narrative
paragraph, bump plugin-card counts (5 commands · 5 hooks · 23 agents).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 17:18:16 +02:00
Kjell Tore Guttormsen
9fea88421d docs(ultraplan-local): add Handover 6 (review → plan) to HANDOVER-CONTRACTS
Closes the iteration loop: review.md → plan via source_findings audit trail.
Adds versioning row, validator-map entry, full Handover 6 section, and
stability summary row mirroring the shape of Handovers 1-5.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 17:13:31 +02:00
Kjell Tore Guttormsen
6b7aee2bf1 feat(ai-psychosis): add 12 pushback + 4 domain regex patterns + cross-check existing 25 2026-05-01 17:10:44 +02:00
Kjell Tore Guttormsen
080f2414ad feat(ai-psychosis): add pushback_count + domain_context state fields 2026-05-01 17:06:09 +02:00
Kjell Tore Guttormsen
1a45caf18b feat(humanizer): translation module with category, action, relevance
Wave 1 / Step 3 of v5.1.0 plain-language UX humanizer.

scanners/lib/humanizer.mjs exports three pure functions:

- humanizeFinding(f) -> new finding object with translated
  title/description/recommendation + three new fields
  (userImpactCategory, userActionLanguage, relevanceContext).
- humanizeFindings(findings) -> mapped array.
- humanizeEnvelope(env) -> walks env.scanners[].findings.

Plus computeRelevanceContext(filePath) as a named export for
unit testing.

Field semantics:
- userImpactCategory: from scanner prefix per research/02 line 124
  (Configuration mistake / Conflict / Wasted tokens / Dead config /
  Missed opportunity / Other).
- userActionLanguage: from severity per research/02 line 134
  (Fix this now / Fix soon / Fix when convenient / Optional cleanup
  / FYI).
- relevanceContext: deterministic file-path heuristic — looks for
  /tests/fixtures/ or /test/fixtures/ substring (test-fixture-no-impact),
  *.local.* basename (affects-this-machine-only), defaults to
  affects-everyone. No subprocess, no network.

Lookup order per scanner: static[title] -> patterns regex match ->
_default -> fall through to original strings (when scanner prefix
absent).

Original id, scanner, severity, file, line, evidence, category,
autoFixable, and optional details are preserved exactly. Pure —
verified by deepEqual of input before/after.

Test (32 cases): purity, field preservation across all paths,
known/unknown scanner handling, all 5 severities, all 6 categories,
relevance heuristic for 4 path types, envelope walking, ANSI-free
guarantee. All pass.
Regression: 689/689 tests (657 + 32 new = 54 new across Wave 1).

Project: .claude/projects/2026-05-01-config-audit-ux-redesign/
2026-05-01 17:03:49 +02:00
Kjell Tore Guttormsen
02ee2a8b83 feat(humanizer): translation table for 12 scanners + plugin-health
Wave 1 / Step 2 of v5.1.0 plain-language UX humanizer.

scanners/lib/humanizer-data.mjs exports TRANSLATIONS keyed by
scanner prefix (CML, SET, HKV, RUL, MCP, IMP, CNF, GAP, TOK, CPS,
DIS, COL, PLH). Each scanner has:

- static: exact-title -> {title, description, recommendation}
- patterns: array of {regex, translation} for template-literal titles
- _default: graceful fallback for unknown findings

Architectural change vs. plan: keys translations by exact scanner
title (not finding ID). Reason: finding IDs are sequence-based
(global counter in lib/output.mjs:34), not stable per finding-type
— two runs can produce different IDs for the same logical issue.
Title strings ARE stable (defined as string literals or template
patterns in the scanner source).

Translations follow research/03 SR-1..SR-17:
- active voice, second person, present tense
- sentences <= 25 words
- tier1 absolute prohibitions and tier3 domain jargon are kept out
  of prose
- tier1/tier3 terms are permitted inside `backtick spans` (code
  references like filenames and field names) — established
  technical-doc convention

Test (12 cases): all 13 scanners covered; every static and pattern
entry has the 3 required fields; tier1 and tier3 forbidden-word
checks pass (with backtick-span exclusion); reference-stable
imports. All pass.
Regression: 657/657 tests (645 + 12 new).

Project: .claude/projects/2026-05-01-config-audit-ux-redesign/
2026-05-01 17:00:59 +02:00
Kjell Tore Guttormsen
367877bb45 docs(ultraplan-local): wire ultrareview-local + 4 agents into plugin CLAUDE.md 2026-05-01 17:00:09 +02:00
Kjell Tore Guttormsen
7dc643ec52 feat(ultraplan-local): teach ultraplan-local to consume type:ultrareview 2026-05-01 16:58:32 +02:00
Kjell Tore Guttormsen
b4e58e3fc2 feat(ultraplan-local): add commands/ultrareview-local.md 2026-05-01 16:56:47 +02:00
Kjell Tore Guttormsen
74eb41fa35 feat(ultraplan-local): add agents/review-coordinator.md 2026-05-01 16:54:54 +02:00
Kjell Tore Guttormsen
8c07fe3493 feat(humanizer): forbidden-words data file (tier1/2/3)
Wave 1 / Step 1 of v5.1.0 plain-language UX humanizer.

tests/lint-forbidden-words.json defines the SC-3 forbidden-words
vocabulary used by the lint runner (Wave 4 / Step 8) and the
humanizer-data translation guard (Wave 1 / Step 2).

- Tier 1: 19 absolute prohibitions (failure if matched in default
  output) — sourced from Microsoft Writing Style Guide, Federal
  Plain Language, GOV.UK, Google Developer Style, Apple HIG.
- Tier 2: 24 strong-avoidance terms (warning if matched) — same
  sources plus Mailchimp.
- Tier 3: 12 domain-specific jargon terms (failure if matched in
  default output, allowed in --raw and --json paths) — sourced
  from research/03 jargon table.

Counts diverge from plan.md (18/21/11) — JSON tracks the brief's
verbatim lists at research/03 lines 200-202 plus tier3 hook entry
from the brief's table. Plan revision noted in audit-doc.

Test: 10 cases verifying parse, count, schema completeness, spot
checks per tier, no cross-tier duplicates. All pass.
Regression: 645/645 tests (635 + 10 new).

Project: .claude/projects/2026-05-01-config-audit-ux-redesign/
2026-05-01 16:53:37 +02:00
Kjell Tore Guttormsen
b9150d4927 feat(ultraplan-local): add agents/code-correctness-reviewer.md 2026-05-01 16:53:27 +02:00
Kjell Tore Guttormsen
33969540af feat(ultraplan-local): add agents/brief-conformance-reviewer.md 2026-05-01 16:52:19 +02:00
Kjell Tore Guttormsen
29ee34113f feat(ultraplan-local): add agents/review-orchestrator.md 2026-05-01 16:50:51 +02:00
Kjell Tore Guttormsen
2397ffb5e4 chore(humanizer): pre-flight snapshots + test audit for v5.1.0
Wave 0 / Step 0 of the v5.1.0 plain-language UX humanizer plan.

Captures v5.0.0 baseline output for all 8 CLIs at
tests/snapshots/v5.0.0/ — these snapshots are immutable references
for SC-6 (--json byte-equal) and SC-7 (--raw byte-equal) tests in
later waves.

- 5 CLIs captured via --output-file: scan-orchestrator, posture,
  token-hotspots-cli, manifest, whats-active
- 3 CLIs captured via stdout redirect (no --output-file support):
  drift-cli (after baseline seed), fix-cli, plugin-health-scanner
- Posture stderr scorecard captured separately for SC-7 stderr-mode
  comparison

docs/v5.1.0-test-audit.md classifies all 42 .title references in
7 known test files: 34 will break under humanization (literal
string equality / substring), 8 are safe (test fixtures or error
formatting). This document is the change list for Step 4.

Project: .claude/projects/2026-05-01-config-audit-ux-redesign/
2026-05-01 16:47:13 +02:00
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 config-audit/v5.0.0
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