Skip to content

Compress Skywalker classification and anti-cascade sections - #965

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-7665-compress-skywalker-classification
Sep 13, 2026
Merged

Compress Skywalker classification and anti-cascade sections#965
TheGreatAxios merged 2 commits into
mainfrom
cl-7665-compress-skywalker-classification

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Implements CL-7665: compress the
Skywalker classification opening and the anti-cascade section in
src/agent/directors/skywalker/package.ts (SKYWALKER_SECTIONS only).

What changed

  • Classification opening (PRIMARY INTENT): one short paragraph — DIY
    tiny edits, Delegate substantial work to specialists, answer questions
    yourself (COMMUNICATION first, never a fleet). Drops the "mandatory
    workflow before responding" framing.
  • Request shape block (was "Mandatory workflow for every request"):
    restructured around the two lanes (tiny → DIY, substantial → spawn with
    counsel//plan plan in the brief) plus docs-routing and the explicit
    plan-optional carve-out for tiny parent-DIY edits.
  • Anti-cascade: keeps no parallel diagnostic waves, one successor with a
    changed brief, no successor on cancel, interrupt-is-resume. Fixes:
    COMMUNICATION may use parent read/search (explorer only on a single
    unknown path, no numeric cap); the "do not search as substitute" rule is
    scoped to failed-worker IMPLEMENTATION follow-up.

Untouched: spawnGraph, GUIDELINE_SUB_BLOCKS, and all other sections
(sibling CL-7654 owns nearby sections; second-to-land rebases).

Token counts (chars / words / ~tokens at chars/4)

Section Before After Delta
classification opening 668 / 102 / ~167 433 / 62 / ~108 -35%
workflow block 2428 / 358 / ~607 1634 / 239 / ~408 -33%
anti-cascade 1982 / 307 / ~496 1903 / 288 / ~476 -4%
systemPrompt total 14136 / ~3534 13032 / ~3258 -7.8% (-1104 chars)

Anti-cascade shrinks less because the mandated fixes add scoping words; the
section is net-negative while carrying the new COMMUNICATION and
IMPLEMENTATION-handoff qualifications.

Verification

  • bun test src/agent/directors/skywalker/ src/prompts.test.ts src/agent/prompt-sizes.test.ts — pass (67 + 292 across director suites; prompt-quality markers and envelope assertions hold)
  • bun run check (lint + typecheck + build + guarded suite) — exit 0: 7132 pass, 0 fail, 25731 expects
  • Note: the first full-gate run caught src/prompts.test.ts "agent identity"
    (buildChatRole must contain "Delegate"); the compressed opening now keeps
    "Delegate substantial work to specialists". No test changes for that — the
    existing pin stands.

Eval plan (no live spend in-branch)

Prompt-behavior confirmation for the parent, per evals/capability/README.md
confirmation gate (5 repeats, frozen baseline
evals/capability/results/baseline-0286.json):

bun run eval:capability -- --case tier-med \
  --matrix "gpt=<provider>:<gpt-model>,kimi=<provider>:<kimi-model>" \
  --repeats 5 --out evals/capability/results/cl-7665-med.json \
  --baseline evals/capability/results/baseline-0286.json

bun run eval:capability -- --case tier-hard \
  --matrix "gpt=<provider>:<gpt-model>,kimi=<provider>:<kimi-model>" \
  --repeats 5 --out evals/capability/results/cl-7665-hard.json \
  --baseline evals/capability/results/baseline-0286.json

Gates: no per-cell pass-rate regression vs baseline; turns and
manage_tasks medians not rising; both gpt and kimi cells green. Refreeze the
baseline only if a behavior change is accepted.

@linear-code

linear-code Bot commented Sep 13, 2026

Copy link
Copy Markdown

CL-7665

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Audit (builder) — HOLD honored, comment-only, no code changes

No merge from this review — the hold stands. No code touched.

Compression verified, behavior-preserving. Classification block 27→17 lines (~-35%); anti-cascade trimmed by roughly a third with tighter COMMUNICATION-first wording; net file 211→198 lines. The cuts are wording, not behavior — with the deliberate exceptions below, each covered by a pin.

Pins hold. The follow-up commit restores the two load-bearing guardrails the compress dropped: the plan gate (“builder blocks if the plan is still missing”) and the permission-asks/long-clock anti-dig line, each with a test pin. The new report-envelope header test (Summary / Findings / Blockers / Paths) is a good pin against future compressions silently dropping the worker contract.

Workflow-list ownership split with CL-7654. The removed 5-step workflow list (interview → explorer → greybeard → counsel → track) no longer lives in the prompt; that sequencing now belongs to CL-7654. Acceptable, but it is a real dependency: if CL-7654 slips, the prompt alone no longer teaches the full chain. Keep the link explicit at merge.

Per-stall cap retained via “MAY spawn one successor”. Failed-wait / incomplete-report keeps one successor with a changed brief — one per stall, still fail-closed against re-dispatching the same brief, and now correctly scoped to IMPLEMENTATION handoffs (“do not search the repo as a substitute for that failed IMPLEMENTATION handoff”). No unbounded retry ladder introduced.

Diff read: gh pr diff 965 (2 commits, package + test pins).

@TheGreatAxios
TheGreatAxios force-pushed the cl-7665-compress-skywalker-classification branch from 94fa6db to 86714ec Compare September 13, 2026 20:13
@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Hold lifted per operator — the do not merge (0.3.25 posture) line is removed from the body.

Rebased onto origin/main (3855ccc1). One conflict in src/agent/directors/skywalker/package.ts (failed-wait successor bullet), resolved keep-both: main's one-successor cap sentence + the branch's IMPLEMENTATION handoff scoping on the do-not-search rule. Diff vs main is back to the two Skywalker files only.

Verification on the rebased tip (86714ec1):

  • bun test src/agent/directors/skywalker/ src/agent/prompts.test.ts src/agent/prompt-sizes.test.ts — 60 pass, 0 fail
  • bun run typecheck (tsc --noEmit) — exit 0

No merge — leaving it for the review fleet.

@TheGreatAxios
TheGreatAxios merged commit 2074b5e into main Sep 13, 2026
9 checks passed
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.

1 participant