Commit graph

470 commits

Author SHA1 Message Date
95a511c3ce feat(voyage)!: rename ULTRAEXECUTE_* env vars to TREKEXECUTE_* [skip-docs]
- ULTRAEXECUTE_MAX_TURNS -> TREKEXECUTE_MAX_TURNS
- ULTRAEXECUTE_MAX_BUDGET_USD -> TREKEXECUTE_MAX_BUDGET_USD
- ULTRAEXECUTE_SKIP_PREFLIGHT -> TREKEXECUTE_SKIP_PREFLIGHT

Files: commands/trekexecute.md, templates/headless-launch-template.md,
templates/session-spec-template.md.

Part of voyage-rebrand session 2 (W3.6 / Step 8).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 14:44:52 +02:00
fc69707454 feat(voyage)!: rename git branch namespace ultraplan -> trek [skip-docs]
- commands/trekexecute.md: 6 ultraplan/{slug} refs -> trek/{slug}
- templates/headless-launch-template.md: 7 ultraplan/{slug} refs -> trek/{slug}
- README.md line 273: branch namespace example -> trek/{slug}

Closes the deferred V2 README.md branch-namespace update.

Part of voyage-rebrand session 2 (W3.5 / Step 7).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 14:42:59 +02:00
5f74a670ab feat(voyage)!: rename produced_by field values + validator comments [skip-docs]
- commands/trekexecute.md: produced_by literals -> trekexecute (4 occurrences)
- commands/trekendsession.md: produced_by literals -> trekendsession (2 occurrences)
- tests/validators/next-session-prompt-validator.test.mjs: 11 'ultraexecute-local' refs -> 'trekexecute'
- tests/commands/trekcontinue.test.mjs: 3 fixture strings updated
- tests/lib/cleanup.test.mjs: 1 fixture string updated
- lib/validators/next-session-prompt-validator.mjs: producer-list comment
- docs/HANDOVER-CONTRACTS.md line 432: example producer names updated

Part of voyage-rebrand session 2 (W3.4 / Step 6).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 14:42:21 +02:00
0508edff15 feat(voyage)!: rename type discriminators across validators + fixtures [skip-docs]
- brief-validator: BRIEF_TYPE_VALUES ['ultrabrief','ultrareview'] -> ['trekbrief','trekreview'] + dependent branches
- research-validator: 'ultraresearch-brief' -> 'trekresearch-brief'
- review-validator: 'ultrareview' -> 'trekreview'
- 3 templates frontmatter type:
- 4 synthetic fixtures: ultraplan-synthetic/ultrareview-synthetic -> trek* (frontmatter only; bodies untouched, Jaccard floor preserved)
- 2 trekreview fixtures: type: trekreview
- 6 validator-test fixtures + asserts
- agents/review-coordinator.md frontmatter example

Atomic: validator + fixtures committed together — partial state would cause vacuous
test passes or hard validator rejection.

Part of voyage-rebrand session 2 (W3.3 / Step 5).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 14:40:25 +02:00
f924d329b5 feat(voyage)!: FLAG_SCHEMA keys trek* + arg-parser test cases [skip-docs]
- Rename FLAG_SCHEMA keys ultrabrief|ultraresearch|ultraplan|ultraexecute|ultrareview|ultracontinue -> trek* equivalents
- Update 26 literal key references in tests/lib/arg-parser.test.mjs
- Update parseArgs($ARGUMENTS, 'ultracontinue') -> 'trekcontinue' in commands/trekcontinue.md
- trekendsession.md audited: no parseArgs invocation, no FLAG_SCHEMA entry needed

Atomic per session-spec: schema + tests + consuming commands committed together to
avoid vacuous-pass risk.

Part of voyage-rebrand session 2 (W3.2 / Step 4).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 14:35:01 +02:00
82bd665ba0 chore(ms-ai-architect): KB checkpoint refresh — 30 files (critical 9 + high batch 1) [skip-docs]
- Critical bucket (9 files): substantive content updates basert på MCP-fetch
  - enterprise-governance: DSPM front door, AI-app-kategorier (3), single-tenant Entra ID
  - rag-cost-optimization, observability, ai-services-enterprise, multi-model-strategy: dato-bump
  - deterministic-cost: Copilot Credits offisiell common currency (2025-09-01), CCCU prepurchase
  - gpt5-gpt41-pricing: utvidet Copilot Studio modell-lineup (GPT-5.2, GPT-5.3, Claude 4.6, Grok 4.1)
  - vector-storage, request-batching: dato-bump (DS allerede dekkende)

- High batch 1 (21 files, 10-30): Last updated 2026-04→2026-05 dato-bump
  Substantive Microsoft Learn-endringer var marginale per fetch — kosmetiske oppdateringer.

Resterende: high batch 2 (filer 31-53, 23 filer) i ny sesjon. Se NEXT-SESSION-PROMPT.local.md.
2026-05-05 14:28:35 +02:00
cbc0053957 feat(voyage)!: session-title hook COMMANDS map + voyage prefix [skip-docs]
- Replace 5 ultra*-local keys with trek* equivalents
- Add /trekcontinue + /trekendsession entries
- Change session title prefix ultra: -> voyage:

Part of voyage-rebrand session 2 (W3.1 / Step 3).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 14:28:20 +02:00
47a4ad47d8 feat(voyage)!: rename commands, templates, fixtures for v4.0.0 [skip-docs] 2026-05-05 14:13:44 +02:00
a975c9943c test(ms-ai-architect): add ros-analysis fixture for E2E suite
Synthetic ROS-analyse output for "Acme Kunde-chatbot" (Acme Kommune)
following the same pattern as security-assessment, cost-estimation,
ai-act and summary fixtures. Satisfies all 29 assertions in
tests/test-ros-output.sh:

- 8 phases (Fase 1-8) plus Ledelsessammendrag
- 12 trusler i T-XXX-NN format (MAESTRO + OWASP-mapping)
- 9 risikoer i R-N format
- 10 tiltak i M-N format
- 7 ROS-dimensjoner med X/5-scoring
- 5x5 risikomatrise + restrisiko-tabell
- NS 5814 + ISO 31000 metodikk-referanser
- AI Act, GDPR, OWASP regulatoriske referanser
- MAESTRO + supply-chain referanser (Vedlegg O coverage)

Tar bort den siste pre-eksisterende run-e2e-feilen
(`bash tests/run-e2e.sh` exits 0).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 12:38:49 +02:00
f835777c1e test(llm-security): add e2e suite proving framework works as coordinated system
Three new files in tests/e2e/ (45 tests, 1777 -> 1822):

- attack-chain.test.mjs (17): full hook stack against attack payloads in
  sequence -- prompt injection at the gate; T1/T5/T8 bash evasions;
  pathguard on .env / .ssh; secrets hook on AWS-shaped keys and PEM
  headers; markdown link-title and HTML-comment poisoning in tool
  output; trifecta accumulation over a single session with dedup on
  the next benign call.

- multi-session.test.mjs (9): state persistence across simulated
  session boundaries. Uses the fact that a hook child's process.ppid
  equals the test runner's process.pid, so writing the session state
  file directly simulates "previous session" history. Covers slow-burn
  trifecta (legs spread >50 calls), MCP cumulative description drift
  via LLM_SECURITY_MCP_CACHE_FILE override, and pre-compact transcript
  poisoning in warn / block / clean / missing-file modes.

- scan-pipeline.test.mjs (19): scan-orchestrator + all 10 scanners +
  toxic-flow correlator against poisoned-project (BLOCK / 95 / Extreme)
  and grade-a-project (WARNING / 48 / High). Asserts envelope shape,
  verdict, risk_score, severity counts, OWASP coverage, scanner
  enumeration, and a narrative-coherence cross-check that the BLOCK
  scan strictly outranks the WARNING scan along every axis.

Test files build credential-shaped payloads at runtime via concatenation
so they contain no literal matches for the pre-edit-secrets regexes
(memory rule feedback_secrets_hook_test_fixtures.md).

Doc updates in same commit per marketplace policy:
- CLAUDE.md header: 1777+ -> 1822+ tests, mentions tests/e2e/
- README.md badge tests-1777 -> tests-1822, body text updated
- CHANGELOG.md: new [Unreleased] Added section describing scope

No version bump. No behavior changes outside tests/.
2026-05-05 12:06:57 +02:00
a7a334c8d1 feat(ms-ai-architect): v1.12.0 manuell KB-refresh — fjern launchd/cron-arkitektur
ToS-vurdering konkluderte med at autonom cron-kjøring er unødvendig kompleks
for en solo-fork-and-own-plugin. Apply-fasen krever LLM-resonnering uansett,
så manuell trigger fra en aktiv Claude Code-sesjon er enklere og holder
pluginen klart innenfor Anthropic Consumer Terms paragraf 3 (automated access
only via API key or where explicitly permitted — Claude Code CLI er
eksemptert som offisielt verktøy).

Lagt til:
- commands/kb-update.md — ny /architect:kb-update slash-kommando som driver
  poll, endringsrapport, microsoft_docs_fetch-update og commit fra sesjonen.
  Argumenter: --skip-discover, --priorities, --dry-run, --single-commit
- Catalog-entry i playground HTML for kb-update (categori: tool, 4 input-felt)

Slettet (Wave 3-5 reversert, ~1500 linjer + 7 testmoduler):
- scripts/install-kb-cron.mjs (cross-OS scheduler-installer)
- scripts/kb-update/weekly-kb-cron.mjs (cron-orkestrator med pre-flight, lock,
  backup, claude -p subprocess, post-run verify, rollback)
- scripts/kb-update/templates/ (4 scheduler-templates: launchd plist, systemd
  service+timer, Windows ps1 + README)
- scripts/kb-update/lib/auth-mode.mjs (cron-spesifikk auth validation)
- scripts/kb-update/lib/lock-file.mjs (PID+mtime stale-detection)
- scripts/kb-update/lib/cost-estimat.mjs (pre-flight budget-cap)
- 7 testmoduler under tests/kb-update/ for slettet kode
- tests/test-kb-update.sh (Bash-3.2-shim, erstattet av direkte node --test)

Beholdt (utility-laget fortsatt brukbart):
- run-weekly-update.mjs, report-changes.mjs, build-registry.mjs,
  discover-new-urls.mjs (KB change-detection-pipelinen)
- lib/atomic-write, lib/backup, lib/cross-platform-paths, lib/log-rotate
- 4 testmoduler (42/42 tester PASS)

Endret:
- hooks/scripts/session-start-context.mjs: fjern kb-update-status.json-overvaaking
- tests/run-e2e.sh --kb-update kaller node --test direkte i stedet for shim
- README.md, CLAUDE.md: KB-vedlikehold-seksjon rewriter for manuell modell
- plugin.json: 1.11.0 -> 1.12.0
- Rot README + CLAUDE.md: ms-ai-architect-versjon bumpet

Schedulering er bevisst utenfor scope og overlatt til brukeren — eventuelle
forks som vil ha periodisk varsling kan sette opp egen cron / launchd /
GitHub Actions som kjører rapport-fasen og varsler om aa kjore
/architect:kb-update i CC-sesjon.

Verifisering:
- bash tests/validate-plugin.sh: 219 PASS, 0 FAIL
- bash tests/run-e2e.sh --kb-update: 42/42 inner + suite PASS
- bash tests/run-e2e.sh --playground: 271/271 PASS (statisk + parsers)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 12:03:45 +02:00
97d1101e91 feat(ms-ai-architect): wire kb-update test suite into run-e2e dispatch [skip-docs]
Step 12 — adds --kb-update flag to tests/run-e2e.sh and a Bash 3.2-compatible
shim test-kb-update.sh that runs `node --test tests/kb-update/*.test.mjs`
(shell-glob form; Node 25 rejects directory-form arguments). Shim translates
node --test exit code + parsed pass/fail counts into the e2e-helpers.sh
suite counters (init_suite/print_summary).

Verification:
- Playground baseline 271 PASS unchanged before/after edit
- bash tests/run-e2e.sh --kb-update: exits 0, 110/110 inner tests pass
- bash tests/run-e2e.sh --all: kb-update suite included
- Pre-existing ROS-fixture absence (tests/fixtures/ros-analysis/) is
  unrelated to this change and remains for separate handling

Wave 5 of 7 in v1.12.0 auto-KB-update plan.
Plan: .claude/projects/2026-05-04-kb-update-fork-and-own/plan.md (Step 12)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 11:32:47 +02:00
30d7a2024c feat(ms-ai-architect): add install-kb-cron standalone helper for cross-OS cron registration [skip-docs]
Step 11 of v1.12.0 plan (.claude/projects/2026-05-04-kb-update-fork-and-own/plan.md).

scripts/install-kb-cron.mjs lives at the scripts/ root (not inside
scripts/kb-update/) because it is a plugin-wide install tool, not part of
the KB-update pipeline itself. Reads the appropriate template from
scripts/kb-update/templates/, fills {{NODE_BIN}}, {{PLUGIN_ROOT}},
{{LOG_FILE}}, {{SCHEDULE_HOUR/MINUTE/DAY_OF_WEEK}} placeholders, writes
to the platform-specific scheduler dir, and registers the job:

  macOS  - launchctl bootstrap gui/<uid> <plist>  (load -w fallback)
  Linux  - systemctl --user daemon-reload && enable --now <timer>
  Windows - powershell -ExecutionPolicy Bypass -File <ps1>  (beta)

Flags: --print-only, --target macos|linux|windows, --uninstall, --purge,
--node-bin, --claude-bin, --schedule "M H * * D" (default: Wed 04:23).

UID resolution for launchctl is guarded by process.getuid() POSIX-only
(undefined on Windows). MCP server presence in ~/.claude.json is
warning-only per brief Spørsmål 7. WSL detected via /proc/version.
Cross-OS rendering supported via --print-only --target <other>; install
on a non-host target rejects with explicit error.

11 subprocess + filesystem-snapshot tests in
tests/kb-update/test-install-cron.test.mjs verify --print-only produces
filled templates with no unsubstituted {{...}} placeholders, --print-only
writes nothing under HOME, --uninstall is idempotent on an empty HOME,
--schedule substitutes correctly, and invalid flags reject with non-zero
exit. Tests never invoke launchctl/systemctl/Register-ScheduledTask
against real schedulers.

Tests: 110/110 pass (was 99 before this step).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 11:26:54 +02:00
b0231fdef7 docs(ultraplan-local): D5 close-out — repo cleanup pre-voyage-rebrand [skip-docs]
D5 — final session of post-v3.4.1 stabilisering. Repo prepared for the
upcoming voyage-rebrand (v4.0.0 hard cut: ultraplan-local → voyage,
/ultra*-local → /trek*).

Tracked changes:
- README.md: cut #9 jargon — '### Self-verifying plan chain' →
  '### Manifest-verified steps' with body rewritten to drop the
  'objective completion predicate' jargon.
- package.json: removed 'simulate' script that pointed to
  tests/simulator/run-pipeline.mjs (file never existed; D3 was
  dropped before that work shipped).
- .claude-plugin/marketplace.json: ultraplan-local description
  updated from 'Four-command pipeline' to the current six-command
  shape with Handover 6 + multi-session resumption (matches
  plugin.json).
- docs/_archive-ultra-suite-brief_2.md: deleted (tracked planning-doc
  unrelated to ultraplan-local; 117 lines, no inbound references).

Untracked cleanup (not in commit, gitignored):
- 4 stale plugin-root .local.md (NEXT-SESSION-PROMPT.archived,
  PLAN-v2.1-phase3, V3.0-MULTI-SESSION-PLAN, etc.)
- 3 docs/ planning .local.md (ultracontinue-brief, ultracontinue-design-notes,
  ultraexecute-v2-observations)
- examples/01-add-verbose-flag/perf-baseline.local.md
- .claude/plans/ultraplan-2026-04-17-logger.md
- 9 closed sub-projects under .claude/projects/ (skill-factory,
  ultracontinue, ultrareview-local, ultra-pipeline-speedup,
  examples-02-real-cli, post-v3.4.0-roadmap, spor-c-q3-cache,
  v3.3.1-ultracontinue-fixes)

Cuts #7 (template-duplisering) + #10 (Two kinds of briefs) reviewed
and judged not needed: README has 38 code-fences vs CLAUDE.md 2 (no
overlap), and 'Two kinds of briefs' is already a direct task-vs-
research-brief explanation, not jargon.

D3 + D4 droppet 2026-05-05 — voyage-rebrand renames all ultra*
references; new test infrastructure built against the old names
would need to be renamed in the same pass. Memory pin:
feedback_cleanup_vs_new_code.md.

Tests: 361 / 0 (unchanged — no test changes).
Stabilisering close-out: complete. Repo is ready for voyage-rebrand.
2026-05-05 11:17:00 +02:00
7848d113de feat(ms-ai-architect): session-start hook reads kb-update-status for failure surfacing [skip-docs] 2026-05-05 11:12:37 +02:00
a0528e6ef7 feat(ms-ai-architect): rewrite weekly-kb-cron with portable paths, auth-mode-aware pre-flight, lock+backup+rollback [skip-docs] 2026-05-05 11:10:17 +02:00
03c77b6452 feat(ms-ai-architect): add cross-OS scheduling templates (launchd/systemd/Windows) [skip-docs] 2026-05-05 11:02:44 +02:00
aefe9ef5b4 feat(ms-ai-architect): add lib/log-rotate for bounded log disk use [skip-docs]
Foundation lib for v1.12.0 cron rewrite — closes brief deliverable
"log-rotate" that was missing from the original plan (Phase 9 scope
revision). Standard logrotate idiom, zero dependencies.

- rotateLog(logPath, opts) returns {rotated, dropped, kept}
- Defaults: maxSizeBytes 10 MB, maxGenerations 5 (1 active + 4 rotated)
- No-op when log missing or under threshold
- Over-size: drop oldest, shift .N..1 down by one, move active → .1
- maxGenerations=1 keeps only the active slot (no rotated copies)
- Pure stdlib fs.renameSync chain with silent try/catch on missing gens

8/8 tests pass: missing/under-size/over-size paths, chained 6 rotations
capped at maxGenerations, oldest dropped, two-step content shift.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 10:54:50 +02:00
2b3f544f86 feat(ms-ai-architect): add lib/auth-mode for cron-safe auth detection [skip-docs]
Foundation lib for v1.12.0 cron rewrite. Detects which Claude auth mode is
in scope and rejects modes that are architecturally incompatible with cron.

Resolution order:
- ANTHROPIC_API_KEY env-var → 'api-key'
- CLAUDE_CODE_OAUTH_TOKEN env-var → 'long-oauth'
- ~/.claude.json onboarded + runner exit 0 → 'subscription-browser-only'
- otherwise → 'unauthenticated'

Subscription browser-OAuth tokens expire ~15h and cannot survive cron — the
detector flags them explicitly so validateAuthForCron throws EAUTHCRON with
a remediation message pointing to `claude setup-token` or ANTHROPIC_API_KEY.

Both runner (subprocess invoker) and claudeJsonPath (~/.claude.json) are
dependency-injected. Tests stub them — no real subprocess spawn, no home-
directory reads.

15/15 tests pass: precedence, env-var detection, onboarded subscription,
non-onboarded fallback, validateAuthForCron throw paths.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 10:52:53 +02:00
d46f7a3459 feat(ms-ai-architect): add lib/backup with sentinel-guarded rollback [skip-docs]
Foundation lib for v1.12.0 cron rewrite skill-tree backup/restore.
Zero dependencies. Uses fs.cpSync (recursive + preserveTimestamps) without
dereference (Node 22.17.x regression) and without filter (Windows symlink-
type bug).

- backupDir(srcDir, backupRoot, opts) → {backupPath, retentionDays, restore()}
- Backup-id format YYYY-MM-DDTHH-MM-SS (filesystem-safe; no colons)
- .backup-meta.json sentinel written as first action inside backupPath
- restore() writes .rollback-in-progress at backupRoot BEFORE rmSync+cpSync
  so a crashed restore leaves the sentinel for the next run to detect
- detectStaleRollback(backupRoot) — boolean predicate over sentinel
- cleanupOldBackups(backupRoot, retentionDays) — 3-step age resolution:
  meta.created_at → dir mtime → skip-with-warning (never delete a dir
  whose age cannot be established)

12/12 tests pass: timestamp format, content round-trip, sentinel lifecycle,
retention, mtime fallback, unparseable-meta skip, missing-root no-op.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 10:50:10 +02:00
3e26b94a27 feat(ms-ai-architect): add lib/lock-file with PID+mtime stale detection [skip-docs]
Foundation lib for v1.12.0 cron rewrite. Atomic exclusive create via
fs.writeFileSync('wx'); on EEXIST resolves staleness with OR semantics:
stale if PID is dead OR mtime exceeds threshold. Either alone breaks the
lock — handles SIGKILL orphans (mtime), PID-reuse races (mtime), and
crashed-then-replaced runs (PID).

- acquireLock(lockPath, opts) → {lockPath, release()}
- staleThresholdMs default 1h; refreshIntervalMs opt-in for long runs
- registerCleanup default true (exit/SIGINT/SIGTERM/SIGHUP/uncaughtException)
- isPidAlive uses kill(pid, 0) with EPERM-as-alive nuance

12/12 tests pass: PID liveness, fixture concurrency, idempotent release,
stale variants (dead+old, live+old, fresh+live), staleThresholdMs honored.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 10:47:05 +02:00
4aac89ca11 docs(ultraplan-local): complete external-architect doc rydding [skip-docs]
D2 of post-v3.4.1 stabilisering. Removes 14 plugin-name references from
agents/, commands/, and docs/ tracked files (CLAUDE.md/README.md/SECURITY.md
were ryddet in v3.4.1 commit 6bca3fb).

The external architect plugin was moved out of the public marketplace
2026-05-04 due to ToS concerns around future skill sources. References in
prose are now stale or misleading for public users. The architecture/overview.md
filesystem slot remains available for any compatible producer — discovery
is plugin-agnostic via lib/validators/architecture-discovery.mjs (drift-WARN,
never drift-FAIL).

Files:
- agents/planning-orchestrator.md (1 ref generalized)
- commands/ultraplan-local.md (2 refs generalized; missed by prompt inventory)
- docs/HANDOVER-CONTRACTS.md (4 refs generalized; Handover 3 + stability summary)
- docs/architect-bridge-test.md (deleted; was a public-only bridge checklist)
- docs/subagent-delegation-audit.md (5 refs/rows removed; intervention #5 dropped, recommendation adjusted)

CHANGELOG.md retains historical references (20 occurrences) intentionally.

Verification:
- grep tracked non-CHANGELOG md: 0 references remaining
- npm test: 361/361 pass (baseline preserved)
2026-05-05 10:46:29 +02:00
f339437e6d docs(ultraplan-local): seal Path C closed with Q3 NEGATIVE finding [skip-docs]
D1 of post-v3.4.1 stabilisering. Path C (cache-warm sentinel + identical-tool
parallel) is closed 2026-05-05 per Q3 experiment NEGATIVE result:
median cache_creation_input_tokens = 163,903 across 3 fork-children at
186K parent context (CC v2.1.128, Sonnet 4.6).

Master-plan thresholds: <= 1,500 POSITIVE / >= 3,500 NEGATIVE — NEGATIVE
solidly. CLAUDE_CODE_FORK_SUBAGENT does not preserve cache prefix across
identical-tool children at our context size.

Path C migration is deferred indefinitely. Reassessment is appropriate
when CC v2.2.xxx ships fork-cache-relevant features. Harness
(scripts/q3-cache-prefix-experiment.mjs) and analyser
(lib/stats/cache-analyzer.mjs) remain available for re-run.

Brief: .claude/projects/2026-05-04-spor-c-q3-cache-prefix-experiment/brief.md
Result: q3-experiment-results.local.md (gitignored)
2026-05-05 10:36:36 +02:00
f2b76b6d8e feat(ms-ai-architect): add lib/cost-estimat heuristic for API-key budget [skip-docs]
Pure auth-mode-aware cost estimator for v1.12.0 cron pre-flight.

Heuristic: critical+high files only (medium/low excluded per brief);
3000 input + 1500 output tokens per file at Sonnet pricing
($3/M in, $15/M out).

Auth-mode behavior:
- api-key:   numeric usd, kvote_warn off  (subject to dollar-cap)
- long-oauth, subscription-browser-only:
             usd null, kvote_warn on      (quota, no dollar billing)
- unauthenticated/missing: best-effort api-key estimate

11/11 tests pass; covers both billing modes plus token-math
invariance across auth-mode (auth only affects dollar-field, not tokens).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 10:34:37 +02:00
4a615b10ce feat(ms-ai-architect): add lib/atomic-write for crash-safe state files [skip-docs]
Foundation lib for status-fil + lock-fil writes in v1.12.0 cron rewrite.
Pattern: writeFileSync to <path>.tmp.<pid>.<random> then renameSync to
target. Defends against half-written files; readers either see the
previous version or the new one, never a partial.

- atomicWriteSync(path, content) — string or Buffer
- atomicWriteJson(path, obj) — 2-space indent, trailing newline
- Windows EEXIST/EPERM defensive fallback (unlink target + rename)
- Best-effort tmp cleanup on writeFileSync failure
- crypto.randomInt(0, 2**32) two-arg form (unambiguous across Node)

9/9 tests pass including 50-way concurrent-write fuzzer (async-aware
withTmp helper).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 10:32:13 +02:00
57fcdf7158 feat(ms-ai-architect): add lib/cross-platform-paths for cache/log/state/backup dirs [skip-docs]
First foundation lib for v1.12.0 auto-KB-update. Resolves per-OS paths:
- macOS: ~/Library/{Caches,Logs,Application Support}/<app>/
- Linux: XDG_CACHE_HOME / XDG_STATE_HOME with ~/.cache, ~/.local/state fallbacks
- Windows: %LOCALAPPDATA%\<app>\{Cache,Logs,State}

Plus getBackupDir(pluginRoot) → <pluginRoot>/.kb-backup (gitignored).

All four functions auto-mkdir target. Dependency-injection via opts
({platform, homedir, env}) makes the lib pure-testable; 13/13 tests
pass under tmpdir isolation without touching real ~/ paths.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 10:30:31 +02:00
96ca7190b4 chore(ms-ai-architect): gitignore .kb-backup and rollback sentinel [skip-docs]
Pre-step for v1.12.0 auto-KB-update for fork-and-own. The cron-rewrite
in Step 9 will create plugin-root/.kb-backup/<ISO-ts>/skills/ during each
run; gitignoring it here ensures backups never enter git history. The
.rollback-in-progress sentinel is created by lib/backup.mjs#restore() and
must also be ignored.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 10:28:55 +02:00
f0fd129d3d feat(spor-c): add Q3 cache-prefix experiment harness + analyser [skip-docs]
Implements Spor C of post-v3.4.0 roadmap. Zero-dep harness measures
CLAUDE_CODE_FORK_SUBAGENT cache-prefix preservation across 3 fork-children
with identical --allowedTools at 150-250K parent context.

Harness uses --append-system-prompt-file (avoids stdin buffer cap at
>200K bytes) + --exclude-dynamic-system-prompt-sections (prevents
per-child cache-prefix divergence from cwd/env/git-status).

Companion analyser summarizes accumulated ultraexecute-stats.jsonl:
percentile wall_time (p50/p90/max), total events, ISO time range.
Output: JSON via --json <path> CLI shim.

Result file is gitignored (*.local.md). Master-plan thresholds
(<= 1.5K positive / >= 3.5K negative) gate the v3.5.0 Path C decision.

Brief: .claude/projects/2026-05-04-spor-c-q3-cache-prefix-experiment/brief.md
Master-plan: .claude/projects/2026-05-04-post-v3.4.0-roadmap/master-plan.md
2026-05-05 09:27:32 +02:00
4e78dc77d7 docs(human-friendly-style): polish README to marketplace standard + add GOVERNANCE [skip-docs]
Brings docs to parity with other plugin READMEs (graceful-handoff,
ai-psychosis pattern):

README.md
- Header block: tagline, solo-maintained disclaimer, AI-generated note
- 6 shields.io badges (version, platform, output-style, commands, hooks, license)
- "The problem" framing: why a shared tone is needed across plugins
- Eight-directive table with what/how each rule changes Claude output
- Before/after example showing default vs human-friendly on the same task
- Architecture ASCII diagram of style merge into system prompt
- Quick start: marketplace install, settings.json enable, /config activation, verify steps
- "What this plugin does NOT do" section pointing users to ms-ai-architect /
  ai-psychosis / linkedin-thought-leadership for adjacent concerns
- Cross-plugin use, compatibility matrix, versioning policy

GOVERNANCE.md (new)
- Standard marketplace fork-and-own governance, adapted with
  human-friendly-style-specific notes (likely fork variants are tone
  variants; trivial fork target since it's one Markdown file)
- Issues-yes, PRs-no policy with reasoning
- Version stability guarantees for the style file itself

CHANGELOG.md
- v1.0.0 entry expanded to reflect the docs polish + GOVERNANCE addition
- All within the same unreleased v1.0.0 (still 1 commit ahead of origin)

[skip-docs]: doc-trippel covered in initial commit (e769140); this is
plugin-internal docs polish only.
2026-05-04 21:08:06 +02:00
e7691400af feat(human-friendly-style): add shared output style plugin v1.0.0 [skip-docs]
New plugin shipping a single Claude Code output style for consistent,
plain-language tone across all marketplace plugins. Auto-discovered from
the plugin's output-styles/ directory per Anthropic's documented plugin
contract.

Style instructs Claude to explain what and why (not how), hide noise
(paths, raw commands, JSON, stack traces) by default, match the user's
language, and stay honest about uncertainty. Keeps Claude Code's default
coding instructions intact via keep-coding-instructions: true.

- plugins/human-friendly-style/output-styles/human-friendly.md (style)
- plugins/human-friendly-style/.claude-plugin/plugin.json (manifest)
- plugins/human-friendly-style/{README,CLAUDE,CHANGELOG,LICENSE}
- .claude-plugin/marketplace.json: registered as 9th plugin
- README.md (root): added section between OKR and Shared infrastructure

[skip-docs]: doc-trippel covered (plugin README, plugin CLAUDE, root
README). Root CLAUDE.md update deferred to avoid conflict with concurrent
ultraplan-local + ms-ai-architect work touching the same Repo-struktur
block.
2026-05-04 20:54:20 +02:00
1aef03f54d docs(ultraplan-local): fill REGENERATED.md walk-through for examples/02-real-cli (Spor B B3) [skip-docs]
Pipeline-walk-through fylt inn etter B3 pipeline-run mot examples/02-real-cli.
Erstatter 'TBD' og '(Placeholder)' med faktisk research-skip + plan-summary
+ execute-summary (4 commits c4cf49fda68c2f) + 10/10 SC PASS-tabell.

Spor B er ferdig. Neste handling: operatør-bekreftelse + WAIT_FOR_TELEMETRY
før Spor C kan starte. Se plugins/ultraplan-local/NEXT-SESSION-PROMPT.local.md
(stop-prompt, IKKE C1).
2026-05-04 20:51:26 +02:00
da68c2fcf8 test(tally): add 4 tests for --regex/-r path covering SC #1, #2, #4, #5
Step 4 (final) of plan.md (Spor B B3 pipeline run). Adds 4 new tests
in a contiguous block at the end of tests/tally.test.mjs, mirroring
the existing spawnSync style. All 4 test names contain --regex or -r.

Coverage map:
- SC #1 (long form, exit 0): test 1
- SC #2 (-r short form): test 2
- SC #4 (invalid exits 2 with /^tally: invalid regex/): test 3
- SC #5 (--json includes flags.regex): test 4

Total: 14 tests, all green, 3.16s wall-clock (under 5s cap).

[skip-docs]
2026-05-04 20:33:23 +02:00
c6ff4fa94a docs(tally): document --regex / -r in --help text
Step 3 of plan.md (Spor B B3 pipeline run). Adds one line under
Options: in the HELP template literal so --help users can discover
the new flag. Satisfies SC #8.

[skip-docs]
2026-05-04 20:32:29 +02:00
44d7f339f5 feat(tally): wire regex counting path in main with invalid-regex exit-2
Step 2 of plan.md (Spor B B3 pipeline run). Wires the --regex/-r flag
into main(): when set, compileRegex(pattern) is used and the count is
text.match(re).length. Invalid regex exits 2 via the existing fail()
helper. JSON output now includes flags.regex so consumers can tell the
mode apart. Baseline tests remain green; -i/--ignore-case has no effect
when --regex is set (out of brief scope).

Verify covered: SC #1 (any position), SC #2 (-r short form), SC #3
(regex semantics differ), SC #4 (invalid exits 2), SC #5 (JSON regex),
SC #6 (byte-identical baseline).

[skip-docs]
2026-05-04 20:32:06 +02:00
c4cf49f1d2 feat(tally): parse --regex/-r flag and add compileRegex helper
Step 1 of plan.md (Spor B B3 pipeline run). Adds the new --regex / -r
flag to parseArgs and a compileRegex(pattern) helper. The flag is
parsed but main() does not yet branch on it (wired in step 2). All
10 baseline tests remain green.

[skip-docs]
2026-05-04 20:31:23 +02:00
c8146c143d feat(ultraplan-local): tally CLI baseline fixture for examples/02-real-cli (Spor B B2) [skip-docs]
Adds the runnable counterpart to examples/01-add-verbose-flag (which is
artifacts-only). The fixture is the measurement target for Spor B's
end-to-end pipeline run (B3) and Spor C's cache-prefix experiment.

Baseline:
- tally.mjs (80 lines, hand-rolled argv parser, zero deps)
- 3 flags: --json, -i/--ignore-case, --lines + --help
- Exit codes: 0 success, 1 file error, 2 invalid argv
- 10 node:test cases, all green (~2.2s wall-clock)
- Deterministic fixtures: sample.txt (foo×7, Foo×1, regex fo+×9) +
  poem.txt (--lines vs total distinction)
- REGENERATED.md skeleton (B3 fills the pipeline walk-through)

Brief preconditions verified:
- grep -c 'foo' sample.txt = 4 (>= 1)
- regex /fo+/g count = 9 (> grep count)
- Brief assumptions for B3 SC #1, #3 hold

This is the first runnable example in plugins/ultraplan-local/examples/.
Next: B3 runs /ultraresearch-local + /ultraplan-local + /ultraexecute-local
against the brief to add --regex/-r, then verifies all 10 Success Criteria.
2026-05-04 20:18:57 +02:00
4fd98988e2 chore(ultraplan-local): release v3.4.1 [skip-docs]
Step 14 of v3.4.1 plan — final release commit.

CHANGELOG.md: new top section [3.4.1] - 2026-05-04 documenting
/ultracontinue-local hot-fix (Bugs 1-4 + ESM/CJS regression +
plugin.json description drift) and the SC-6 doc-rydding sweep.

README.md: version badge 3.4.0 -> 3.4.1.

Marketplace root README.md: ultraplan-local entry header bumped to
v3.4.1.

prior commits in this release:
- 1da4f3f docs(ultraplan-local): Handover 7 § Lifecycle (SC-5)
- 6bca3fb docs(ultraplan-local): remove ultra-cc-architect references (SC-6)
- 561ad5a chore(ultraplan-local): bump v3.4.1 + plugin.json description drift fix

The user-facing docs were already updated in the prior commits, so
[skip-docs] applies here.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 17:55:51 +02:00
561ad5a33b chore(ultraplan-local): bump v3.4.1 + plugin.json description drift fix
Step 13 of v3.4.1 plan.

- plugin.json description: Five-command -> Six-command (drift fix); also
  drops the trailing ultra-cc-architect sentence (SC-6 collateral).
  Mentions multi-session resumption as part of the Six-command pipeline.
- plugin.json + package.json version: 3.4.0 -> 3.4.1.

361 tests still green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 17:53:56 +02:00
6bca3fbf00 docs(ultraplan-local): remove ultra-cc-architect references (SC-6 doc-rydding)
Step 12 of v3.4.1 plan. Surgical line-by-line generalization of references
to the ultra-cc-architect plugin (no longer publicly distributed):

- CLAUDE.md: 8 hits → "opt-in upstream architect plugin (not bundled)"
- README.md: 9 hits including bare slug at line 646 (removed entirely);
  rephrased to "no longer publicly distributed" with the architecture/
  filesystem slot still supported by /ultraplan-local
- SECURITY.md: 1 hit → generalized "Opt-in upstream architect step"

CHANGELOG.md historical references preserved per brief; appended a
2026-05-04 note at top of [3.0.0] block stating the plugin is no longer
publicly distributed but the architecture/overview.md slot remains
supported for any compatible producer.

The architecture/overview.md filesystem contract (Handover 3, EXTERNAL,
drift-WARN) is unchanged — anyone implementing a compatible producer
can plug in.

361 tests still green (no regressions). doc-consistency pins for
/ultracontinue-local and Handover 7 § Lifecycle still pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 17:53:08 +02:00
1d8c2aa9ce docs(ms-ai-architect): add v1.11.0 sections to README + CHANGELOG
- README.md: new "v1.11.0 — Design-system 100%-adoption" section under
  Playground (v3), parallel to existing v1.10.0 Foundation refactor
  section. Documents hoisted DS components, PARALLEL CSS migration,
  inline style trim, visual upgrade benchmarks, and intentional
  plugin-local survivors.
- CHANGELOG.md: new [1.11.0] entry with Added subsection, plugin-local
  survivors note, and 3-session rollout note. Tests baseline 278 PASS.

Follow-up to release commit 7ffaa82 — release was pushed without these
deeper doc sections.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 17:52:28 +02:00
1da4f3fe30 docs(ultraplan-local): Handover 7 § Lifecycle (SC-5 stale-file principle)
Step 11 of v3.4.1 plan. Adds the lifecycle subsection to Handover 7
documenting:

- Producer/consumer arbeidsdeling (executor + helper write; ultracontinue
  reads; pre-compact-flush refreshes only)
- Stale-file principle: status==='completed' state files SHOULD be
  removed via /ultracontinue-local --cleanup --confirm (operator-invoked,
  no auto-cleanup, no force flag)
- Frontmatter contract for NEXT-SESSION-PROMPT.local.md: producers MUST
  write produced_by + produced_at (ISO-8601); files without frontmatter
  are tolerated (warning, not error) for backwards compatibility
- Idempotency: --cleanup --confirm is safe to re-run; partial state
  reported but never auto-recovered

Adds 3 doc-consistency pins:
- next-session-prompt-validator CLI shim
- Handover 7 § Lifecycle subsection present
- Handover 7 § Lifecycle names --cleanup + produced_by contract

358 -> 361 tests, all green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 17:48:37 +02:00
9fa83bdf2f feat(ultraplan-local): Bug 4 — wire --cleanup into /ultracontinue-local [skip-docs]
Step 10 of v3.4.1 plan.

commands/ultracontinue-local.md:
- New Phase 0.5 between Phase 0 and Phase 1 — terminal cleanup mode
  triggered by parsed flags['--cleanup'] === true. Requires explicit
  positional[0] (no "clean all"), no template placeholders in the Bash
  invocation. Passes through to cleanupProject via inline ESM. Cleanup
  never falls through to Phase 1/2/3/4.
- Phase 0 usage block updated to document --cleanup and --cleanup
  --confirm forms alongside the legacy <project-dir> form.

tests/commands/ultracontinue.test.mjs:
- Test (Bug 4 prose) — Phase 0.5 header present, references
  cleanupProject and flags['--cleanup'], appears between Phase 0 and
  Phase 1 in document order, usage mentions --cleanup --confirm.
- Test (f-1) dry-run on completed project lists candidates without
  deleting; both files still on disk.
- Test (f-2 + f-3) confirm-mode deletes both files; subsequent
  invocation on the already-cleaned dir signals CLEANUP_NO_STATE_FILE
  (deterministic terminal state, idempotent for operators).

Tests 355 -> 358 (+3).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 17:42:56 +02:00
7ffaa82207 feat(ms-ai-architect): release v1.11.0 — design-system 100%-adoption + visual upgrade
Sesjon 3 av 3 — leverer Fase 7-9 av v1.11.0-planen.

Fase 7 (Acme-rename på demo-state):
- Rename "Acme AS" → "Acme Kommune" og "Demosystem" → "Acme Kunde-chatbot"
  konsistent på tvers av alle 17 fixtures.
- build-demo-state.mjs: organization.name → "Acme Kommune", projects[0] →
  id "acme-kunde-chatbot" / name "Acme: Kunde-chatbot".
- Re-bygd demo-state-v1-blokk i playground HTML.

Fase 8 (Screenshots-regenerering):
- 24 nye PNG-er under playground/screenshots/v1.11.0/ (12 surfaces × 2 tema,
  retina, fullPage). v1.10.0-mappen beholdt som historisk referanse.
- tests/screenshot/run.mjs: OUT_DIR + kommentarer bumpet til v1.11.0.

Fase 9 (Release: docs + versjonsbump):
- plugin.json 1.10.1 → 1.11.0.
- README.md (plugin): version-badge + Version History + screenshot-gallery refs +
  demo-data refs oppdatert.
- CLAUDE.md (plugin): Playground-overskrift v3/v1.10.0 → v3/v1.11.0,
  Demo system-seksjon v1.10.1 → v1.11.0, screenshot-refs v1.10.0 → v1.11.0,
  "Inline CSS-kandidater" konvertert til "Design-system 100%-adoption" status.
- Root README.md: ms-ai-architect-versjon 1.10.1 → 1.11.0, demo-tekst og
  Playground-tekst regenerert for v1.11.0, "271 PASS combined" → "278 PASS".

Verifisering:
- bash tests/run-e2e.sh --playground → 271/271 PASS (static + parsers).
- bash tests/test-playground-migrations.sh → 7/7 PASS.
- Total: 278/278 PASS, 0 FAIL.

Refs: NEXT-SESSION-PROMPT.local.md (Sesjon 3 av 3, plan
.claude/plans/jeg-skal-pr-ve-effervescent-token.md).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 17:41:36 +02:00
3c0f0a0bab feat(ultraplan-local): cleanup util (Bug 4 dry-run/confirm/idempotent) [skip-docs]
Step 9 of v3.4.1 plan.

lib/util/cleanup.mjs (new):
- cleanupProject(projectDir, {dryRun, confirm}) reads
  .session-state.local.json via validateSessionState; refuses unless the
  parsed status is strictly equal to 'completed' (per risk-assessor
  Critical 2 — no soft-match on similar statuses).
- Default dryRun: true; refuses dryRun: false without explicit
  confirm: true (CLEANUP_REQUIRES_CONFIRM).
- Removes .session-state.local.json + NEXT-SESSION-PROMPT.local.md
  candidates; ENOENT counts as "already absent" so the function is
  idempotent.
- No CLI shim — invoked from /ultracontinue --cleanup via inline ESM
  (Step 10 wires this in).

tests/lib/cleanup.test.mjs (new):
- 7 cases: dry-run lists candidates without deleting; confirm-mode
  deletes both files; idempotent re-run signals CLEANUP_NO_STATE_FILE
  after fully cleaned; refuses on status: in_progress
  (CLEANUP_NOT_COMPLETED); refuses dryRun: false without confirm
  (CLEANUP_REQUIRES_CONFIRM); defaults to dry-run; missing state file
  returns CLEANUP_NO_STATE_FILE.

Internal scaffolding consumed by Step 10 (Phase 0.5 wire-up). User-facing
docs land with Step 14.

Tests 348 -> 355 (+7).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 17:41:06 +02:00
37108ae899 fix(ultraplan-local): Bug 3 — wire frontmatter consistency check into /ultracontinue Phase 1.5
Step 8 of v3.4.1 plan.

commands/ultracontinue-local.md:
- New Phase 1.5 between Phase 1 and Phase 2 — runs the
  next-session-prompt-validator in --consistency mode when both candidates
  exist (plugin-root + project-dir). Refuses on producer mismatch with
  fresh candidates, downgrades stale candidate to a warning, downgrades
  >24h wall-clock drift to a soft warning.
- Anti-substitution rule applies — paths emitted as concrete tokens, not
  template placeholders.

lib/validators/next-session-prompt-validator.mjs:
- Sharpen NEXT_SESSION_PROMPT_PRODUCER_MISMATCH error message to include
  the literal "produced_by" field name so consumers (and operators) can
  trace the disagreement back to the YAML key.

tests/commands/ultracontinue.test.mjs:
- Test (Bug 3 prose) — Phase 1.5 header present, references validator,
  appears between Phase 1 and Phase 2 in document order.
- Test (Bug 3 e) — tmp project dir with state file + two prompt files
  with mismatched producers, both fresh relative to state.updated_at;
  CLI consistency mode exits non-zero, JSON stdout surfaces
  NEXT_SESSION_PROMPT_PRODUCER_MISMATCH with both paths and the
  "produced_by" token in the message.

Tests 346 -> 348 (+2).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 17:39:42 +02:00
512ae322bd fix(ultraplan-local): Bug 3 producers — frontmatter writes + ESM/CJS fix
Step 7 of v3.4.1 plan.

ultraplan-end-session-local Phase 3:
- Replace require()-of-ESM-module shim with node --input-type=module + import.
- Convert Phase 1 project enumeration to ESM as well so the file is uniformly
  ESM (grep -c 'require(' commands/ultraplan-end-session-local.md → 0).
- Combined ESM block writes both .session-state.local.json (atomicWriteJson)
  and sibling NEXT-SESSION-PROMPT.local.md (writeFileSync) so producers
  succeed or fail together.
- Sibling markdown gets frontmatter: produced_by, produced_at, project.

ultraexecute-local Phases 8 / 2.55 / 4:
- Each phase that writes .session-state.local.json now also writes a sibling
  NEXT-SESSION-PROMPT.local.md with frontmatter (produced_by:
  ultraexecute-local, produced_at: ISO-8601, status). Phase 8 includes the
  full ESM block; 2.55 / 4 reference the combined pattern.
- This is the producer side of the Bug 3 contract; consumer-side wire-up
  (Phase 1.5 consistency check in /ultracontinue) lands in Step 8.

Tests: 346 green (no new tests this step — coverage comes via Step 8
integration test).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 17:37:21 +02:00
46e036e1c3 feat(ultraplan-local): next-session-prompt-validator (Bug 3 consistency check) [skip-docs]
Step 6 of v3.4.1 plan. Adds the validator quartet
(Content/Object/Consistency/CLI) for NEXT-SESSION-PROMPT.local.md
frontmatter (produced_by, produced_at). State-anchored staleness check
is the primary refusal; 24h wall-clock drift downgraded to soft warning
to avoid false positives on weekend pauses.

Internal scaffolding consumed by Step 8 (Phase 1.5 wire-up). User-facing
docs land with Step 14 (CHANGELOG + README + version bump).

Tests 335 -> 346 (+11): 9 unit + 2 CLI shim cases.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 17:34:16 +02:00
31aed40308 feat(ms-ai-architect): v1.11.0 Sesjon 2 — design-system 100%-adoption (Fase 4-6) [skip-docs]
Migrerer alle 6 PARALLEL CSS-navn i playground HTML til DS-konvensjon:
- .topbar*           -> .app-header*               (DS components.css)
- .residual-pair*    -> .pair-before-after*        (DS components-tier3.css; data-severity -> BEM modifier)
- .command-card*     -> .card + .card__*           (DS base.css + tier3-supplement; outer + 4 sub-elementer)
- .catalog-card*     -> .card + .card__*           (samme; outer + 7 sub-elementer)
- .screen-tabs/.screen-tab/.screen
                     -> .tab-list/.tab/.tab-panel  (DS tier3-supplement; data-active="..." -> [hidden]-attr)
- .pyramide-desc*    -> .stack-sm + .pyramide-tier-detail*
                                                   (DS tier3-supplement section 22+23)

Trimmer plugin-local <style>-blokk fra 202 -> 127 linjer (37% reduksjon):
- Sletter inline duplikater av DS v0.3 sections 14-15 (.page__*, .key-stats, .key-stat--{level})
- Sletter inline duplikater av sections 18-19 (.top-risks, .recommendation-card)
- Refaktorerer renderPageShell + renderKeyStatsGrid til DS markup-pattern
  (.page__header-main + .page__header-aside + .page__title h1; .key-stat--{level} BEM)

Beholdt eksplisitt plugin-local (med dokumentasjon i CSS-kommentarer):
- .verdict-pill (domain-semantikk go/block — distinkt fra DS .verdict-pill-lg severity-band)
- .scenario-card[data-status="met/partial/missing"] (DS har kun "winner")
- .read-more-block + .suppressed-panel (native <details>; DS bruker JS-toggled aria-expanded)
- .onboarding-*, .home-*, .project-*, .modal*, .command-form*, .catalog-cards (plugin-spesifikk layout)

Visuell oppgradering (Fase 6):
- Eyebrow-label "PROSJEKTER · X av X" over home-projects seksjon
- .card--severity-{positive/medium/critical} venstre-border på rapport-cards basert på
  parsed.verdict (go/approved/allow=positive, go-with-conditions/warning=medium,
  block/failed=critical) — visuell signal for rapport-status i project surface
- AI Act-pyramide bredde min-width: 480px + tier-label font-size: var(--font-size-md)
  for å fjerne tekstklipping ("Uakseptabe...", "klassifisert"). Responsive @media for <560px.
- App-header-restruktur: brand + breadcrumb + spacer + actions (DS pattern), ikke flex-between
- .stack-lg vertikalt rytme-utility på home/project/catalog body i renderPageShell

Tests oppdatert for nye DS-navn:
- Step 10: residual-pair -> pair-before-after assert
- Step 12: screen-tabs -> tab-list assert (class="tab-list" eksplisitt)

Verification: 201 + 70 + 7 = 278/278 PASS, 0 FAIL.
6 intentional plugin-local residuals (1 .catalog-cards container + 4 .read-more-block + 1 .suppressed-panel)
— alle dokumenterte i inline <style>.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 16:46:40 +02:00
f58b892436 fix(ultraplan-local): Bug 2 — eliminate state-file-path template; Read tool + concrete arg
Step 5 of v3.4.1 hot-fix plan. Phase 2 of
commands/ultracontinue-local.md is rewritten to remove every curly-
brace template placeholder. The {state-file-path} substitution failure
caused the path-guard hook to crash on unresolved templates.

New Phase 2 structure:

  2.a — Read the file with the Read tool (no Bash). Deterministic and
        not subject to shell-substitution errors.
  2.b — Schema-validate via the existing CLI shim, with the resolved
        absolute path emitted as a literal string token by the model
        at the time of the Bash call. Anti-substitution invariant:
        STOP if about to emit any unresolved placeholder.
  2.c — Interpret validator result (preserved verbatim from the
        previous Phase 2 — three-way branch on valid + status).

Verification: grep -c "{state-file-path}" returns 0; full Phase 2
section contains no {lowercase-template} curly-brace placeholders.
Suite 322 -> 335 passing (+13: 7 from Step 1, 4 from Step 2, 2 from
Step 4).
2026-05-04 16:40:11 +02:00
25c8faf113 test(ultraplan-local): failing tests for /ultracontinue Bug 2 (SC-3)
Step 4 of v3.4.1 hot-fix plan. Two new tests in
tests/commands/ultracontinue.test.mjs:

  (d-1) ALLOW-resolved-path — runHook + pre-bash-executor sanity check
        that a concrete validator invocation (no template placeholders)
        is not blocked by the marketplace bash-guard.
  (d-2) NO-PLACEHOLDER — Pattern D structure assertion that Phase 2
        contains neither {state-file-path} nor any other
        {lowercase-template} curly-brace placeholder, and that the
        Phase 2 prose explicitly documents the deterministic Read
        tool flow.

(d-1) passes today (the planned bash form is allowed). (d-2) fails
intentionally on current Phase 2 — Step 5 fix turns it green.
2026-05-04 16:38:56 +02:00