Skip to content

kahuna: Plan #581 — Wave-pattern hardening (operational backlog campaign A)#595

Merged
bakeb7j0 merged 12 commits intomainfrom
kahuna/581-wave-pattern-hardening-campaign-a
May 5, 2026
Merged

kahuna: Plan #581 — Wave-pattern hardening (operational backlog campaign A)#595
bakeb7j0 merged 12 commits intomainfrom
kahuna/581-wave-pattern-hardening-campaign-a

Conversation

@bakeb7j0
Copy link
Copy Markdown
Contributor

@bakeb7j0 bakeb7j0 commented May 5, 2026

Kahuna integration MR for Plan #581. All 11 issues completed across 2 waves; ready for kahuna→main merge after the four-signal trust gate.

Plan completion

Plan: #581 — Wave-pattern hardening (operational backlog campaign A)
Phases: 1 of 1
Issues: 11 of 11 (100%)
Stat: 18 files changed, 2836 insertions, 119 deletions

Wave 1 — 5 flights, 10 issues (all CLEAN reviewer pass)

PR Commit Issue Subject
#584 0ef6a21 #490 fix(nextwave): clarify harness async-routing contract
#585 98b8058 #495 fix(wave-status): print JSON envelope on mutation subcommands
#586 0b1fda5 #556 fix(install): union-merge hook matcher arrays in merge_settings
#587 96c69e6 #496 chore(policy): enable allow_auto_merge across Wave-Engineering fleet
#588 6c8970e #545 chore(hooks): catch inverted precheck-asking phrasings
#589 d018338 #521 fix(wave-status): preserve cross-repo issue refs in state.json keys
#590 579f282 #502 fix(wavemachine): restore Discord embed card callsites in v2 skill
#591 9d7feb9 #540 chore(logging): add logrotate policy for ~/.claude/logs/mcp.jsonl
#592 ded543a #524 chore(wavebus): formalize CHANGELOG fragment aggregation
#593 9e08c79 #500 feat(nextwave): wire plan_mark_story_done into Prime(post-flight)

Wave-1 used 4 flights (5/3/1/1). The flight_partition algorithm correctly pre-identified file-overlap conflicts (state.py, install, skills/nextwave/SKILL.md) and sequenced issues into separate flights to avoid in-wave conflicts.

Wave 2 — 1 flight, 1 issue (rework cycle: 1 CRITICAL + 1 IMPORTANT mechanically fixed before merge)

PR Commit Issue Subject
#594 21748ef #560 fix(install): adopt Cellar + symlink-farm layout for orphan-free re-deploys

#560 is the only issue this campaign that had non-CLEAN initial review. Two findings were fixed via amended commit before merge:

  1. CRITICALenumerate_farm_targets used GNU-only find -printf '%f\n', silently breaking macOS installs (zero symlinks created → AC feat: complete repo scaffolding — CI, settings, sync, uninstall, changelog #2 silently violated). Replaced with portable find ... | sed 's|^\./||' pattern.
  2. IMPORTANTcellar_install_file flat-namespaced skill helpers (last-writer-wins collision risk). Added cellar_install_skill_helper() + farm_symlink_skill_helper() for namespaced \$CELLAR_DIR/skills/<skill_name>/<helper_name> layout.

Re-review confirmed REWORK CLEAN. Per WAVE_AXIOMS Axiom 5 (continuing cheaper than stopping), the rework cycle was preferred over merge-and-followup since both fixes were mechanical.

Campaign artifacts

Anomalies and follow-ups

  1. pr_wait_ci unsuitable for kahuna PRs. cc-workflow's `validate.yml` triggers on pull_request → main only. Kahuna PRs have 0 status checks; pr_wait_ci times out at 1800s. Flights 2-4 of wave-1 short-circuited via `gh pr view`. Suggests a tool-side improvement: detect empty status-check rollup and exit early.
  2. pr_merge GraphQL fallback. After the first kahuna PR enrolls in the merge queue, subsequent pr_merge calls fail with "Protected branch rules not configured" until the queue settles. Direct `gh pr merge --squash --delete-branch` works. Likely related to lesson_pr_merge_wait_regression.md.
  3. wave_finalize artifact requirement. wave_finalize returned no_artifacts because /nextwave auto's per-wave cleanup wipes the bus on PASS. Either preserve artifacts under a different namespace, or have wave_finalize accept a manually-assembled body. This kahuna PR was opened directly via gh as a workaround.
  4. chore(policy): mcp-server-discord has enablePullRequestAutoMerge disabled — bring into policy_wave_engineering_merge_config compliance #496 drift expansion. While auditing mcp-server-discord for allow_auto_merge compliance, the Flight discovered 3 additional drifted Wave-Engineering repos (mcp-server-nerf, mcp-logger, commutativity-probe). All were remediated via fleet-audit pattern; merge-queue compliance for those repos is a separate audit.
  5. generate-status-panel AttributeError. Hit `'NoneType' has no attribute 'replace'` when wave_next_pending returns null after final wave. Minor; doesn't block.
  6. Prime(post-flight) sub-agent stall on sleep. Wave-2 flight-1 Prime sub-agent ended its turn mid-sleep (waiting for CI poll). Orchestrator recovered cleanly because the PR was already created. Suggests sub-agent harness behavior worth filing.

Trust-gate readiness

This MR is ready for the four-signal gate:

  • commutativity_verify (single-target mode against main)
  • ci_wait_run (validate.yml will fire on pull_request → main)
  • code-reviewer Agent (full kahuna-vs-main diff)
  • trivy fs (HIGH/CRITICAL vulnerabilities)

Closes #581

🤖 Generated with Claude Code

bakeb7j0 and others added 11 commits May 5, 2026 14:55
Update skills/nextwave/SKILL.md Step 3b/3c to reflect the harness-side
contract that same-block Agent calls without explicit run_in_background
must all route synchronously, and tighten Step 3c's collection prose
so future readers do not introduce a defensive bus-polling fallback.
The actual harness fix is out-of-scope for this repo.

Closes #490

Co-authored-by: Baker B <bakerb@waveeng.com>
The mutation subcommands (flight, flight-done, close-issue, record-mr,
waiting, wavemachine-stop) wrote state.json correctly but crashed during
response-shaping with 'str object has no attribute .get()'. Capture the
mutation return dict, print json.dumps({"ok": True, "state": ...}) after
the dashboard regenerates, and guard the regen call so envelope output
survives a regen failure.

Closes #495

Co-authored-by: Baker B <bakerb@waveeng.com>
Extend the union-merge logic already used for permissions.allow to
event matcher arrays. For each event present in both template and
local settings.json, add any template matcher entry whose .matcher
value is not present locally; leave existing local entries untouched.
Update --check to report missing matchers as actual gaps.

Closes #556

Co-authored-by: Baker B <bakerb@waveeng.com>
…587)

Audited Wave-Engineering GitHub repos against
policy_wave_engineering_merge_config (memory). Enabled
allow_auto_merge on mcp-server-discord (the only known
non-compliant repo). Full audit results in PR description.

Closes #496

Co-authored-by: Baker B <bakerb@waveeng.com>
Add a third regex alternation to scripts/precheck-asking-detector.sh
covering inverted forms ("Is /precheck something I should run?",
"Would /precheck be appropriate here?", etc.). Includes a
false-positive guard for "/precheck completed. Should I commit now?"
to avoid blocking valid post-precheck phrasing.

Closes #545

Co-authored-by: Baker B <bakerb@waveeng.com>
…589)

When phases-waves.json declares an issue with a qualified ref
(owner/repo#N) and the issue has no per-issue repo override,
state.json's issues dict keys were getting the orchestrator repo
slug substituted in. _issue_repo() now extracts the repo from the
qualified ref so state.json keys match phases-waves.json refs verbatim.

Closes #521

Co-authored-by: Baker B <bakerb@waveeng.com>
)

Wavemachine v2 dropped the fire-and-forget calls to
scripts/discord-status-post. Add them back at all state-change
points: wavemachine launch, post-wave_complete, all five terminal
exits, and post-wave_flight_done in /nextwave Prime(post-flight).
Update the Status Panel Lifecycle prose to reflect the script being
invoked, not just referenced.

Closes #502

Co-authored-by: Baker B <bakerb@waveeng.com>
Add assets/logrotate/cc-mcp-logs with size 100M / daily / rotate 14 /
copytruncate. Install via the new --with-logrotate flag in install (or
interactive prompt). --check reports rotation status. Documented in
docs/operations/log-rotation.md and cross-referenced from CLAUDE.md.
Linux-only; macOS path documented separately.

Closes #540

Co-authored-by: Baker B <bakerb@waveeng.com>
Add scripts/wavebus/changelog-aggregate (deterministic fragment merge
under ## Unreleased), wire it into /nextwave Prime(post-wave) before
wave_complete, and have Flight stubs write CHANGELOG.fragment.md
instead of editing CHANGELOG.md directly. flight_partition stretch
(commutative_append_files hint) deferred to a separate
mcp-server-sdlc sub-issue.

Closes #524

Co-authored-by: Baker B <bakerb@waveeng.com>
Add the per-issue plan_mark_story_done call into the Prime(post-flight)
merge sequence: after wave_close_issue + wave_record_mr, read
**Plan:** #M from the story issue's ## Metadata section and call
plan_mark_story_done({plan_ref: M, story_id: X}). warn_only failures
do not abort the merge sequence. The handler itself ships in
mcp-server-sdlc (cross-repo follow-up sub-issue).

Closes #500

Co-authored-by: Baker B <bakerb@waveeng.com>
…eploys (#594)

Wipe-and-recreate ~/.claude/scripts/ as the Cellar; replace direct
~/.local/bin/ deploy with a symlink farm pointing into the Cellar.
Stale-symlink reaper kills orphans without --prune. merge_settings()
rewrites old ~/.local/bin/hooks/... paths to ~/.claude/scripts/hooks/...
and continues to union-merge new matcher entries (preserves #556).

Granularity B: only top-level scripts/ entries get symlinks; subtrees
(hooks/, vox-providers/, testing/) stay Cellar-only. ./install --check
reports both stale symlinks and old-path hook commands as drift. User
customizations (plain files at ~/.local/bin/<name>) are backed up to
.bak before symlink replacement. Foreign symlinks (target outside the
Cellar) are never reaped.

Closes #560

Co-authored-by: Baker B <bakerb@waveeng.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t from install (#596)

Resolves the kahuna→main trust-gate finding on Plan #581 PR #595:
scripts/install-remote.sh (the curl | bash flow) was missing the three
install-hardening features merged this campaign into install. This commit
ports them so curl-bash users get the same on-disk shape.

- #540 logrotate: --with-logrotate / --without-logrotate flags + Linux-gated
  install_logrotate_config + --check drift detection.
- #556 hook union-merge: merge_settings() now union-merges matcher arrays
  for shared event keys, with --check reporting "missing matcher" drift.
- #560 Cellar + symlink-farm: deploys to $CELLAR_DIR=~/.claude/scripts and
  farms top-level symlinks to ~/.local/bin/. Skill helpers namespaced
  under $CELLAR_DIR/skills/<skill_name>/<helper>. Portable
  find ... | sed 's|^\./||' pattern (no -printf — BSD/macOS).

Closes #581 install-remote.sh parity.

Co-authored-by: Baker B <bakerb@waveeng.com>
@bakeb7j0 bakeb7j0 added this pull request to the merge queue May 5, 2026
Merged via the queue into main with commit 0f86c2d May 5, 2026
1 check passed
@bakeb7j0 bakeb7j0 deleted the kahuna/581-wave-pattern-hardening-campaign-a branch May 5, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plan: Wave-pattern hardening — operational backlog campaign A

1 participant