Commit graph

478 commits

Author SHA1 Message Date
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
baff890789 docs(shared): add PLAYGROUND-MAINTENANCE.md procedure
Documents the 4-track procedure for updating plugin playground HTML
when plugins are extended or upgraded:

- Track A: Plugin HTML change (parsers, renderers, surfaces)
- Track B: Shared design-system change (with vendor sync)
- Track C: Visual verification (screenshots + manual QA)
- Track D: Release (version bump + 3-doc rule)

Lives at marketplace root because the procedure crosses the
plugin/shared boundary. Marketplace-root CLAUDE.md gets a one-line
pointer under Konvensjoner so Claude finds it automatically in
future sessions.

Includes architecture diagram, common pitfalls (replace_all scope,
sync-without-testing, screenshot folder version mismatch, background
orchestrator degradation), and guidance on when to hoist inline CSS
to the shared DS vs keep it plugin-local.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 19:43:23 +02:00
4fd98988e2 chore(ultraplan-local): release v3.4.1 [skip-docs] v3.4.1
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
100ffe94f1 fix(ultraplan-local): Bug 1 — strict --help match + .md-arg diagnostic + Date.parse sort
Step 3 of v3.4.1 hot-fix plan. Three fixes in
commands/ultracontinue-local.md:

  - Phase 0: replace "$ARGUMENTS contains --help or -h" with parsed-arg
    dispatch via parseArgs(...,'ultracontinue'). Usage block fires only
    when flags['--help'] === true OR positional[0] === '-h'. Empty,
    whitespace, and project-dir args fall through to Phase 1
    (auto-discovery), which is the operator-default invocation.
  - Phase 1.a: NEW — reject .md positional arg with SC-2 diagnostic
    ("expected <project-dir>" + "did you mean to paste"). Operators
    pasting a NEXT-SESSION-PROMPT.local.md path see a clear error
    instead of a confusing fallthrough.
  - Phase 1.b: auto-discovery node -e now emits {path, updated_at}
    JSON per candidate; Phase 1 sorts numerically via
    Date.parse(updated_at) DESC instead of lexicographic compare.
    Newest in_progress wins, including across year-boundary timestamps.

All 4 Step 2 regression tests now green; full suite 322 → 333 passing.
2026-05-04 16:38:04 +02:00
06c0a0a86b test(ultraplan-local): failing tests for /ultracontinue Bug 1 (SC-1, SC-2)
Step 2 of v3.4.1 hot-fix plan. Establishes tests/commands/
directory and adds Pattern D structure tests against
commands/ultracontinue-local.md prose:

  (a) Phase 1 must document Date.parse(updated_at) numeric sort
  (b) Phase 0 must NOT use substring "contains --help" dispatch;
      must reference parsed flags or positional[0]
  (c) Phase 1 must reference auto-discovery as empty-args fallback
  (d) Phase 1 must emit SC-2 diagnostic strings for .md positional arg

Tests (a), (b), (d) fail intentionally on current prose; Step 3
fix turns them green. Test (c) passes already (current Phase 1
prose says "non-empty" which matches the regex assertion).
2026-05-04 16:36:44 +02:00
7cdbcb7425 test(ultraplan-local): add ultracontinue to FLAG_SCHEMA + tests
Step 1 of v3.4.1 hot-fix plan (project 2026-05-04-v3.3.1-ultracontinue-fixes).

Adds ultracontinue entry to FLAG_SCHEMA covering boolean flags --help,
--cleanup, --confirm, --dry-run with no valued flags. The -h short form
is intentionally not aliased: it appears as positional[0] === '-h' and
the command prose dispatches usage on either condition.

7 new tests in tests/lib/arg-parser.test.mjs verify empty args, --help,
-h positional, --cleanup, --cleanup --confirm, project-dir positional,
and .md positional (parser-level accept; command-level reject).
2026-05-04 16:34:55 +02:00
40631c0eee feat(playground-design-system): v0.3.0 — playground/report-page foundation primitives [skip-docs]
Hoists 13 generic CSS components (sections 13-25 in tier3-supplement) from
ms-ai-architect inline CSS to shared/ so all 5 plugin consumers get the same
vocabulary and visual signature.

Shared additions:
- .eyebrow utility, .page__* page-shell (header/title/eyebrow/lede/meta)
- .key-stats grid + .key-stat + severity modifiers (large tabular-nums values)
- .verdict-pill-lg 5-band extension (critical/high/medium/low/positive/n-a)
- .tab-list / .tab / .tab-panel generic tab-component
- .top-risks / .top-risk[data-severity] severity-ordered risk list
- .recommendation-card[data-severity] emphasized advisory callout
- .card__head/title/desc/id/meta/hint/actions/pill subcomponents
- .card--severity-{level} 4px left-border modifier
- Form patterns (.field-row, .field-label, .field-help, .multi-select,
  .checkbox-row, .required-mark)
- .stack-lg/.stack-md/.stack-sm vertical rhythm utilities
- .pyramide-tier-detail expandable details below pyramide
- .scenario-card-grid + .scenario-card[data-status="winner"] grid pattern
- .app-shell / .app-shell--wide / .app-shell--narrow page wrappers

Total: 567 new lines in tier3-supplement.css, 107 new selectors. Purely
additive — no existing selector changed or removed. v0.2 -> v0.3.
DS CHANGELOG.md updated with full v0.3 entry.

ms-ai-architect playground:
- Re-synced vendored DS to v0.3 (force flag — overwrites stale v0.2 vendor)
- Deleted 8 inline DUPLICATE definitions (.app-shell* + form patterns) now
  served by shared DS
- Inline <style> block: 210 -> 202 lines (start of multi-session refactor;
  remaining PARALLEL classes migrate in Session 2)

Tests: 215 + 201 + 70 + 7 = 493 PASS. No regressions.

Plugin user-facing docs (README, CLAUDE.md, marketplace landing) update in
Session 3 (Phase 9) when full v1.11.0 ships. This commit is internal
foundation work — DS CHANGELOG already documents the shared changes.

Session 1 of 3 in v1.11.0 design-system 100%-adoption refactor.
Plan: /Users/ktg/.claude/plans/jeg-skal-pr-ve-effervescent-token.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 10:00:44 +02:00
e3378e9b9c feat(ms-ai-architect): release v1.10.1 — demo system + screenshot gallery
Adds one-click demo and committed screenshots so forkers see what the plugin
produces without running anything. Plugin contract unchanged.

- Inline <script id="demo-state-v1"> block (37 KB) built by
  scripts/build-demo-state.mjs from playground/test-fixtures/*.md
- "Last inn demo-data" button on onboarding (replaces all state with demo)
- raw_markdown persistence on project.reports[id] with equal-value guard
- rehydratePasteImports() auto-fills textareas + re-renders visualizations
  on project surface mount
- tests/screenshot/ standalone Playwright runner (own package.json)
- 24 committed screenshots in playground/screenshots/v1.10.0/
  (12 surfaces x 2 themes, deviceScaleFactor 2 retina, fullPage)

Tests: 215 + 201 + 70 + 7 = 493 PASS, no regressions.

Docs updated per OBLIGATORISK three-level rule (plugin README, plugin CLAUDE,
marketplace root README, CHANGELOG).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 09:24:02 +02:00
67240f01f6 test(ultraplan-local): add path-guard + bash-guard baseline hook tests (SC8 baseline)
Pins existing BLOCK rules in the two pre-* executor hooks so a future
silent weakening of BLOCK_RULES surfaces as test failures instead of
slipping through code review.

50 new tests covering both hooks plus allow-list pins (lib/, tests/,
docs/, ls, git, npm) and fail-open on malformed input. Reuses
tests/helpers/hook-helper.mjs child-process spawner.

[skip-docs]
2026-05-04 08:55:49 +02:00
df6212a878 docs: bump ultraplan-local v3.4.0 in marketplace root
Mirrors the v3.4.0 ship in plugins/ultraplan-local/. Marketplace root
README plugins table + CLAUDE.md plugin inventory both updated.
2026-05-04 08:53:04 +02:00
6f3519c551 chore(ultraplan-local): bump v3.4.0 + autonomy chain + parallel hardenings + schema-drift seal
Ships the speedup work documented in plan-v2 of project
2026-05-03-ultra-pipeline-speedup.

Adds:
- --gates {open|closed|adaptive} flag on all four pipeline commands
- lib/util/autonomy-gate.mjs state machine (idle → main-merged)
- lib/review/plan-review-dedup.mjs (Phase 9 inline dedup)
- lib/stats/event-emit.mjs (autonomy-gate transitions, main-merge gate)
- hooks/scripts/post-compact-flush.mjs PostCompact hook (rehydrate)
- Phase 8 schema-drift seal in commands/ultraplan-local.md
- Phase 2.6 wave-executor 11 hardenings
- Synthetic SC7 determinism floor (Jaccard >= 0.833) for plan + review
- Hook baseline regression pins (path-guard + bash-guard)
- examples/01-add-verbose-flag/perf-measure harness (gitignored)

Architecture decision: Path B (sequential --no-ff parallel waves with
manifest-driven failure recovery) ships in v3.4.0. Path C (cache-first
hybrid) deferred to v3.5.0 contingent on Step 6 cache-telemetry harvest.

Memory updates (Step 14, outside-repo files):
- project_ultraplan_opus47_gap.md rewritten per Path B (mitigated v1.8.0
  + plan-step-7 defense-in-depth; residual risk for plugins NOT using
  ultraplan-local prompt arch)
- MEMORY.md one-liner updated to flag mitigation status
2026-05-04 08:52:55 +02:00
bc1333ec17 chore(ultraplan-local): generalize *.local.* gitignore for perf-measure script
Replaces explicit *.local.md + *.local.json rules with single *.local.*
glob covering the new examples/01-add-verbose-flag/perf-measure.local.sh
and perf-baseline.local.md operator-driven measurement harness for SC1
wall-time gate.

The harness files themselves stay outside git (operator-run only). The
.gitignore generalization is the only tracked change.

[skip-docs]
2026-05-04 08:47:52 +02:00
0c0a87e709 test(ultraplan-local): add plan-determinism + review-determinism synthetic fixtures (SC7 floor)
Adds 6 files in tests/synthetic/ exercising the determinism pipeline at the
SC7 brief floor (Jaccard >= 0.833). Plan fixture pair: 40 step titles each
with 38 shared (Jaccard 0.905). Review fixture pair: 30 finding-IDs each
with 28 shared (Jaccard 0.875). Reuses lib/parsers/jaccard.mjs +
lib/parsers/finding-id.mjs.

The new pair coexists with tests/lib/review-determinism.test.mjs which
holds the older SC4 (0.70) floor against tests/fixtures/ultrareview/.
The lower floor protects pipeline regressions; the higher floor anchors
the speedup brief's determinism aspiration.

[skip-docs]
2026-05-04 08:46:39 +02:00
b1738b419c feat(ms-ai-architect): release v1.10.0 — felles grunnskjelett + Tier 3-adopsjon
Playground v3 internal refactor with shared visual signature across all 17
report renderers. Plugin contract (24 commands, 12 agents, 5 skills, 2 hooks,
MCP) is unchanged — release is playground-internal.

- Foundation helpers: renderPageShell, renderVerdictPill, renderKeyStatsGrid,
  inferVerdict, inferKeyStats, KEY_STATS_CONFIG
- Schema v1->v2 migration (idempotent via dataVersion=2 guard)
- Tier 3 supplement components integrated in 11 renderer slots
- Parser extensions: parsePhasedPlan (status/currentPhaseIndex/pocVerdict),
  parseComparison (winner), parseMatrixRisk (_consumer-strategi A)
- Onboarding redesign: 4 strukturerte / 14 fritekst
- Light-theme tokens (Aksel-aligned, WCAG 2.2 AA)
- Validation: 201 statisk + 70 parser + 7 migrasjon = 278 PASS

A11Y-RAPPORT.md populated with code-based static assessment of all 4 surfaces
and 17 renderers. Browser-axe-core run still pending per MANUAL-CHECKLIST.md
section 10.

Docs updated per OBLIGATORISK three-level rule:
- plugin README.md, plugin CLAUDE.md, marketplace root README.md, CHANGELOG.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 08:46:06 +02:00
f43a38421e feat(ultraplan-local): add PostCompact rehydrate hook to re-inject session-state after compaction
New hooks/scripts/post-compact-flush.mjs (PostCompact event, CC v2.1.105+):
auto-discovers <cwd>/.claude/projects/*/.session-state.local.json (most
recently modified), validates it via session-state-validator, emits
additionalContext via stdout so the post-compact assistant turn has
Handover 7 resume context loaded immediately.

Read-only — never writes. Always exits 0; never blocks compaction. Uses
only node:fs sync APIs available since Node 12 (no glob dependency).

Companion to the existing pre-compact-flush.mjs:
  - PreCompact: refresh progress.json + .session-state.local.json
  - PostCompact: re-inject .session-state.local.json into context

Wired in hooks/hooks.json under a new PostCompact matcher block.

Both files staged via /tmp/claude-* and copied into hooks/* via Bash to
respect the llm-security plugin path-guard (which blocks direct Write to
hooks/scripts/*.mjs and hooks*.json).

Test: tests/hooks/post-compact-flush.test.mjs (4 tests) covers no-state,
malformed-state, valid-state, and multi-project mtime selection.
2026-05-04 07:57:42 +02:00
b837274b77 feat(ultraplan-local): emit main-merge-gate stats event from Phase 8
Wire the main-merge-gate lifecycle event into commands/ultraexecute-local.md
Phase 8. Three event variants emitted via lib/stats/event-emit.mjs (S8):
  - main-merge-gate     fired at the gate boundary
  - main-merge-approved fired on operator confirm
  - main-merge-declined fired on operator decline (run recorded as partial)

The gate ALWAYS pauses regardless of gates_mode — it is the one always-on
boundary that --gates does not toggle. On decline, --resume re-enters at
the gate, and the wave session branches survive on the remote thanks to
Hard Rule 19's push-before-cleanup. Recovery surface is documented inline.

Pin in tests/lib/main-merge-gate.test.mjs locks the always-on prose, the
event names, and the recovery-surface contract.
2026-05-04 07:55:41 +02:00
34f62043f9 feat(ultraplan-local): add --gates autonomy-control flag to all four pipeline commands
Single autonomy-control surface (--gates) added to ultrabrief, ultraresearch,
ultraplan, and ultraexecute. When present, sets gates_mode = true and
re-enables approval pauses at every phase boundary + every wave for
high-stakes runs. When absent (default in auto), the chain runs continuously
to the main-merge gate (which always pauses regardless of --gates — that
boundary is the one always-on safety stop).

ultrabrief:    pause after auto-mode confirmation; emit brief-approved event
ultraresearch: pause after each topic completes
ultraplan:     pause after Phases 5, 7, 9
ultraexecute:  pause after each wave's worktrees finish, before merge-back,
               AND before the main-merge gate (MAIN_MERGE_GATE)

All four commands invoke the autonomy-gate state machine via the CLI shim
node lib/util/autonomy-gate.mjs (built in S8). Test pin in
tests/lib/gates-flag-coverage.test.mjs locks the contract.

Also wires the brief-approved stats emission into ultrabrief Phase 5 auto
path (was the SC4 wiring requirement from plan-v2 Step 11).
2026-05-04 07:54:30 +02:00
fc48d01f1e feat(ms-ai-architect): renderer batch C (econ + docs 8) + structural test asserts [skip-docs]
Sesjon 5 av v1.10.0-løpet (8 av 17 renderers wrapped med renderPageShell).
Nå alle 17 renderers bruker felles grunnskjelett (page__eyebrow + h1 + verdict).

Renderers wrapped:
- C.1 renderCost: eyebrow=KOSTNAD, key-stats utvidet med DOMINERENDE-komponent
- C.2 renderLicense: eyebrow=LISENS, scenario-card-grid per kandidat-lisens,
  TOPP-LISENS key-stat
- C.3 renderMigrate: eyebrow=MIGRASJON, E2 mat-ladder erstatter aiact-timeline,
  E4 cycle-ribbon ved aktiv fase
- C.4 renderAdr: eyebrow=ADR, D4 critique-card per beslutningsseksjon, ADR-status
  → verdict-pille (accepted/proposed/rejected/deprecated)
- C.5 renderSummary: eyebrow=SAMMENDRAG, E8 read-more for lange rationale
- C.6 renderPoc: eyebrow=POC, E2 mat-ladder + B5 traffic-light per success-kriterie,
  pocVerdict styrer verdict-pille
- C.7 renderUtredning: eyebrow=UTREDNING, A4 screen-tabs (Bakgrunn/Funn/Konklusjon/
  Anbefaling) + E8 read-more på lange seksjoner
- C.8 renderCompare: eyebrow=SAMMENLIGN, D1 scenario-cards-grid per kandidat,
  parseComparison.winner styrer vinner-pille + VINNER key-stat

Parser-utvidelser (R15 forward-compat — eksisterende fixtures uendret):
- parsePhasedPlan: phases[].status (planned/active/done), currentPhaseIndex,
  pocVerdict (kun ved POC-Verdict-linje)
- parseComparison: optional winner-felt fra "## Vinner: <id>"-linje

Topic 2 strategi A i handlePasteImport: sentralisert _consumer-tildeling
(result.data._consumer ||= cmd.id), respekterer parser-spesifikk verdi
(parseMatrixRisk → 'ros').

Fixture-updates: migrate/poc med Status: per fase + POC-Verdict, compare med
"## Vinner:"-linje.

Test-asserts (tests/test-playground-v3.sh +18 PASS, totalt 201/201):
- 25e SC8 per-renderer for batch C (8 renderers)
- 25f Step 12 must_contain (mat-ladder, screen-tabs, _consumer)
- 25g Felles grunnskjelett: alle 17 renderers bruker renderPageShell
- 25h Tier 3-bruk: kanban i conformity/review, mat-ladder i migrate/poc
- 25i Onboarding field-distribution (4 strukturerte, 14 fritekst)

Verifisert: 201/201 statiske, 70/70 parser-fixtures, 7/7 migrations PASS.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 07:52:52 +02:00
b97251bda3 feat(ultraplan-local): mirror Phase 2.6 hardenings in headless-launch-template
Bring the launch template (used by /ultraplan-local --decompose) into
contract-parity with the Phase 2.6 wave executor hardenings shipped in the
previous commit:

- GIT_OPTIONAL_LOCKS=0 exported once at the top
- MAX_TURNS / MAX_BUDGET_USD env-overridable (default 50 / 5)
- Absolute SHARED_CONTEXT_FILE built from brief + architecture
- SAFETY_PREAMBLE prepended to every per-session prompt (GH #36071 +
  GH #52272 clarifications)
- Per-child --max-turns + --max-budget-usd + --append-system-prompt-file
- push-before-cleanup before merge AND in the cleanup_worktrees trap
- Three new template rules (16, 17, 18, 19) document the contract for
  session-decomposer

Pin in tests/lib/doc-consistency.test.mjs locks all required substrings
against future regressions.
2026-05-04 07:51:50 +02:00
41a0c913fa feat(ultraplan-local): harden Phase 2.6 wave executor (11 sub-changes for plugin-in-monorepo + gitignored-state topology)
Phase 2.6 + Hard Rules + Phase 2.4 hardenings against the topology that
blocked S6 / S7 self-execution:

Phase 2.6 (multi-session orchestration):
  - NEW Step 2a-pre: build absolute SHARED_CONTEXT_FILE (brief + architecture)
    once per wave; introduce ULTRAEXECUTE_MAX_TURNS / ULTRAEXECUTE_MAX_BUDGET_USD
    overrides for long runs.
  - Step 2a: prefix every git worktree command with GIT_OPTIONAL_LOCKS=0
    (research/02 R2; GH #47721).
  - NEW Step 2a': copy gitignored project artifacts (brief.md, plan.md,
    research/) into each freshly-created worktree using PROJECT_SOURCE +
    PROJECT_REL so plugin-in-monorepo + gitignored-state topology works
    (brief Constraint 2).
  - Step 2b: prepend two safety preambles to every per-session prompt:
      (a) defense-in-depth headless-mode warning citing GH #36071
      (b) malware-reminder conditional clarification per GH #52272
    Honor `cwd:` field from Execution Strategy via SESSION_CWD; default
    is worktree root (backward-compatible). Add per-child --max-turns,
    --max-budget-usd, --append-system-prompt-file (research/06 R3+R4).
  - Step 2e: push branch BEFORE merge (research/02 R3 — converts
    unrecoverable branch loss into recoverable remote state).
  - Step 2f: prefix all worktree-remove / branch -d / worktree prune with
    GIT_OPTIONAL_LOCKS=0.
  - Step 4 cleanup: same GIT_OPTIONAL_LOCKS=0 treatment.

Hard Rules:
  - Hard Rule 15: extend exception to permit ~/.claude/projects/*/memory/
    writes when manifest declares memory_write: true (brief Constraint 3
    Option A — narrow opt-in for memory file edits).
  - Hard Rule 19 (new): push-before-cleanup formalized as a rule.

Phase 2.4: advisory hooks-fire precheck for CC version >= v2.1.117
  (research/04 D4 + R5; research/06 R1).

Test: tests/hooks/worktree-guard.test.mjs (6 tests) verifies the
pre-bash-executor and pre-write-executor hooks accept routine worktree
cleanup (Hard Rule 12) while still blocking the dangerous patterns
introduced by parallel orchestration.
2026-05-04 07:49:45 +02:00
272638aec1 feat(ultraplan-local): parallelize Phase 9 review with inline dedup
Strengthen single-message reinforcement for plan-critic + scope-guardian
parallel dispatch in commands/ultraplan-local.md Phase 9 and mirror in
agents/planning-orchestrator.md Phase 6. Reviewers now write structured JSON
to /tmp/{plan-critic,scope-guardian}-out.json which is merged via the
lib/review/plan-review-dedup.mjs CLI shim from S8.

The merged set lets us revise the plan once for duplicate findings instead
of twice. Source: research/05 R1 + R2.

Pin in tests/lib/doc-consistency.test.mjs locks both files against
single-message + dedup-helper regressions.
2026-05-04 07:43:50 +02:00
84eae1fad7 feat(ultraplan-local): seal Opus-4.7 schema-drift defense in Phase 8
Inline STEP_HEADING_REGEX, FORBIDDEN_HEADING_REGEX, the canonical step+manifest
example, and the post-write plan-validator self-check directly into Phase 8 of
commands/ultraplan-local.md. This eliminates the dependency on Opus 4.7
implicitly loading agents/planning-orchestrator.md — the format contract now
travels with the command file itself.

Source: research/04 D5 + plan-v2 Step 7. Pin in tests/lib/doc-consistency.test.mjs
locks the substrings so future edits cannot silently regress the seal.
2026-05-04 07:41:48 +02:00
50f0629baf feat(ms-ai-architect): renderer B.3 review adopt page-header + kanban (Keep/Review/Remove) + suppressed-panel
- parseFindings utvidet med status-felt-deteksjon og buckets-mapping {keep, review, remove, suppressed}
- Eksplisitt status vinner; severity-fallback (kritisk/høy → review, medium/lav → keep)
- Norsk og engelsk status-vokabular støttet (suppress/waive/akseptert, behold/keep, tilsyn/review, fjern/remove)
- renderReview wrapper renderPageShell med eyebrow=REVIEW; bytter findings-listen til E1 kanban-board (3 kolonner Keep/Review/Remove)
- E6 SUPPRESSED-panel som collapsible details for waived/akseptert items
- KeyStats utvidet med KEEP/REVIEW/REMOVE-stats
- review.md fixture utvidet med Status-kolonne (1 remove, 4 review, 2 keep, 2 suppressed)

Pluss test-utvidelser:
- Seksjon 25c: SC8 per-renderer verdict-pill assert for Sub-batch B (renderSecurity, renderRos, renderReview)
- Seksjon 25d: Step 11 must_contain — top-risks + suppressed >=1 treff
- Test-suite gar fra 178 -> 183 PASS

[skip-docs]
2026-05-04 06:35:38 +02:00
20717102aa feat(ms-ai-architect): renderer B.2 ros adopt page-header + top-risks + recommendation-card
ros = REFERENCE STANDARD (mot Plugin Playground-run2/scenarios/ros-lier-kommune.html)

- parseMatrixRisk utvidet med _consumer-detection (ros når ## Top-risikoer eller ## Anbefaling), topRisks[] (max 5, fallback til threats sortert på severity-rank med alfabetisk tie-breaker), og recommendation (første avsnitt under ## Anbefaling)
- R15 regression: hasTopRisks/hasAnbefal-detection er ikke-invasiv; Dpia-fixturer har ingen av disse seksjonene → _consumer=null, topRisks=[], recommendation='' (alle felt forblir uendret for dpia-rendereren)
- renderRos wrapper renderPageShell med eyebrow=ROS; behold matrix 5x5 + radar 7-akser + threats; legg til top-risks-list, residual-pair og recommendation-card
- ros.md fixture utvidet med ## Top-risikoer (5 trusler), Restrisiko: 4x3 to 2x2, og ## Anbefaling
- RESTRISIKO key-stat utledes når residualPair finnes (samme monster som Dpia og Security)

Sesjon 6 (v1.10.0) gjor en samlet README/CLAUDE/CHANGELOG-oppdatering for hele v1.10.0-loypet.

[skip-docs]
2026-05-04 06:33:06 +02:00
bbe7971d01 feat(ultraplan-local): add stats event-emit for autonomy lifecycle events
Step 6 of plan-v2 (ultra-pipeline-speedup).

lib/stats/event-emit.mjs (NEW)
  Atomic JSONL append to ${CLAUDE_PLUGIN_DATA}/ultraexecute-stats.jsonl.
  Every record carries:
    ts          : ISO-8601 timestamp (REQUIRED per SC4)
    event       : caller-supplied name
    known_event : true for { brief-approved, main-merge-gate, user_input },
                  false for everything else (still emitted — audit-complete)
    payload     : caller object (defaults to {})

  Stats failures NEVER block workflow: missing CLAUDE_PLUGIN_DATA, missing
  dir, mkdir failure, append failure → all return { written: false, reason }
  without throwing.

  CLI shim:
    node lib/stats/event-emit.mjs --event NAME [--payload JSON]
  Always exits 0 (telemetry is best-effort).

Tests: 12 (record-build + ISO-8601 ts + known/unknown distinction + silent
skip + dir-on-demand + CLI shim happy-path + bad-payload tolerance +
concurrent-append smoke).

[skip-docs]
2026-05-04 06:31:52 +02:00
bed14eae4a feat(ultraplan-local): add plan-review-dedup helper for Phase 9 finding dedup
Step 5 of plan-v2 (ultra-pipeline-speedup).

lib/review/plan-review-dedup.mjs (NEW)
  Two-pass dedup:
    1. Exact match  — identical computeFindingId(file:line:rule_key) → merge.
    2. Jaccard ≥ 0.7 on text-token sets → merge near-duplicates.
  Provenance preserved in surviving finding's raised_by[] (which agents
  raised it). Reuses lib/parsers/jaccard.mjs + lib/parsers/finding-id.mjs.

  CLI shim:
    node lib/review/plan-review-dedup.mjs \
         --plan-critic /tmp/x.json --scope-guardian /tmp/y.json
  Missing inputs tolerated (single-agent review still works).

Tests: 10 (tokenize + threshold + 6 dedup-logic cases + 2 CLI shim).

[skip-docs]
2026-05-04 06:30:28 +02:00
645f01625b feat(ultraplan-local): add autonomy-gate state machine + manifest schema extensions for skip_commit_check + memory_write
Step 4 of plan-v2 (ultra-pipeline-speedup).

lib/util/autonomy-gate.mjs (NEW)
  5-state machine {idle, gates_on, auto_running, paused_for_gate, completed}
  honoring the --gates flag intent. Re-entry to completed is idempotent.
  Includes CLI shim:
    node lib/util/autonomy-gate.mjs --state X --event Y [--gates true|false]
  → JSON: { ok, next_state | error }, exit 0 on success / 1 on invalid.

lib/parsers/manifest-yaml.mjs (EXTENDED)
  OPTIONAL_KEYS list adds skip_commit_check and memory_write — both boolean,
  default false when absent, MANIFEST_OPTIONAL_TYPE when non-boolean.
  Existing REQUIRED_KEYS contract untouched; existing 9 manifest tests
  still pass.

Tests: 19 (autonomy-gate) + 8 (manifest-schema-extensions) = 27 new.

[skip-docs]
2026-05-04 06:28:47 +02:00