Skip to content

Feat/delegation reflex#259

Merged
cukas merged 6 commits into
mainfrom
feat/delegation-reflex
Jul 16, 2026
Merged

Feat/delegation reflex#259
cukas merged 6 commits into
mainfrom
feat/delegation-reflex

Conversation

@cukas

@cukas cukas commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

…arity

Two review follow-ups from the conquer falsifier round: (1) unattended
--push now refuses to land on a protected branch (main/master by default,
protectedPushBranches config override, case-insensitive, fail-closed on an
unresolvable HEAD) via isProtectedPushBranch in the forge decision core —
a conquer worktree normally sits on its own conquer/<slug> branch, so a
protected HEAD means something unexpected happened and the work stays
committed locally for a human push. (2) the REPL /conquer handler no
longer hardcodes what the CLI exposes: --gate-timeout, --max-hours and
--timeout parse through the intent layer and reach the gate spawn and
runConquer caps, mirroring the CLI defaults (1800s gate, 600s turn, no
wall cap).

⚔️ Forged by [Agon](https://github.com/KERNlang/agon)

Co-Authored-By: agon (KERN) <292465531+KERN-Agon@users.noreply.github.com>
Full-roster review (6/6 engines, 5-engine consensus on the blocker):
KERN codegen emits optional array fields as [] into DEFAULT_AGON_CONFIG,
so every real loadConfig() caller passed { protectedPushBranches: [] } and
the Array.isArray fallback never fired — main/master were NOT protected in
production. An empty or whitespace-only list now falls back to the default
['main','master']; only a non-empty override replaces it. Verified against
the real loadConfig() output. Also: CLI --timeout/--gate-timeout reject
negative values instead of propagating them to spawnWithTimeout (agy), the
REPL /conquer rejects --max-turns < 1 exactly like the CLI (minimax), and
the exact production config state is now a test case (zai).

Refuted (no change): the cqAbort cleanup claim — the handler's KERN
cleanup block generates the finally { ctx.setActiveAbort(null) }, and a
still-running background job after /focus-away is the job system's design.

⚔️ Forged by [Agon](https://github.com/KERNlang/agon)

Co-Authored-By: agon (KERN) <292465531+KERN-Agon@users.noreply.github.com>
…vidence

RAG roadmap 1b (6/6-engine cesar-mode-rag brainstorm design): when the
user's prompt resembles past orchestration runs, the matching episodes
(mode, winner, outcome, duration) are injected ahead of the Cesar turn as
an [EXPERIENCE] block framed as evidence, never authority. New KERN module
cesar/experience.kern: intent summarization (capped, control-char safe),
stopword-filtered token-set Jaccard similarity (no sidecar on the hot
path), and retrieval gated on a similarity floor AND a min-N support
threshold (default 3 qualifying episodes) so a couple of stale runs can't
steer routing. recordRun now stores a 160-char intentSummary; legacy
records without it are skipped. Injection reuses the shouldGroundInput
trigger (slash commands and trivial prompts never retrieve) and is
fail-open. Config: cesarExperience (default on), plus tunable
minSimilarity/minEpisodes/topK/window resolved 0-safe against the
DEFAULT_AGON_CONFIG codegen emission. 14 unit tests.

⚔️ Forged by [Agon](https://github.com/KERNlang/agon)

Co-Authored-By: agon (KERN) <292465531+KERN-Agon@users.noreply.github.com>
…path

Full-roster review (6/6 engines) findings, each verified: (1) codex
blocker — telemetry.json is global, so precedent from one repo could
inject its task text into another repo's turn; run records now store a
projectKey (resolved working dir) and retrieval filters on it, fail-closed
for unscoped legacy records. (2) zai/claude/kimi — the new test file
contained raw NUL/ESC bytes and diffed as binary; escaped to \u
sequences. (3) agy — the prompt is tokenized once per retrieval, not once
per episode (scoreTokenSetSimilarity). (4) agy/zai/kimi/claude — the
ledger read is cached on (mtimeMs,size) so unchanged telemetry.json is
parsed once, and append() trims to MAX_LEDGER_RUNS (2000) so the file
cannot grow unbounded. (5) kimi — tokenization is unicode-aware
(\p{L}\p{N}) so non-English prompts score. (6) codex prompt-replay:
summaries are the user's own local prompts (same trust domain); quote
normalization added for rendering hygiene. Also: buildExperienceBlock
rewritten loop-style to satisfy the kern:self-coverage var-bad-expr
ratchet (every blocker category sits exactly at its cap).

⚔️ Forged by [Agon](https://github.com/KERNlang/agon)

Co-Authored-By: agon (KERN) <292465531+KERN-Agon@users.noreply.github.com>
… tasks

First slice of the 6/6-engine delegation-reflex brainstorm consensus:
a pure veto-first scorer (cesar/delegation-reflex.kern) detects prompts
with ≥3 explicit list items and NO sequential-dependency, shared-artifact,
or small-task markers, and injects an in-prompt structural note that the
work may decompose. Surfacing stays with the existing suggestion flow —
Cesar may offer [SUGGEST:agent-team], promptDelegation confirms with the
user, nothing ever auto-spawns. False positives cost one advisory line by
construction: prose, ordered work, 2-item lists, tiny items, and prompts
under 80 chars never trigger. Config cesarDelegationReflex (default on),
fail-open injection beside the experience block. 10 unit tests.

⚔️ Forged by [Agon](https://github.com/KERNlang/agon)

Co-Authored-By: agon (KERN) <292465531+KERN-Agon@users.noreply.github.com>
Full-roster review (6/6 engines) fixes: (1) kimi — the advisory pointed
Cesar at [SUGGEST:agent-team], a marker parseSuggestion/routing do not
recognize; the canonical action is team-agent (team- prefix + agent).
(2) agy — shared-state vetoes now match plural forms (schemas, lockfiles,
migrations). (3) kimi — the first…then sequential veto is windowed to one
sentence-ish span so unrelated far-apart mentions no longer over-veto.
Recorded as by-design: multiline list items measured by their first line
(under-triggering is the stated cost asymmetry) and the shouldGroundInput
reuse (generic real-prose predicate, and the reflex carries its own
80-char floor).

⚔️ Forged by [Agon](https://github.com/KERNlang/agon)

Co-Authored-By: agon (KERN) <292465531+KERN-Agon@users.noreply.github.com>
@cukas
cukas merged commit cebce61 into main Jul 16, 2026
2 checks passed
@cukas
cukas deleted the feat/delegation-reflex branch July 16, 2026 14:08
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.

2 participants