v1.86.0.0 feat: route outside reviews by harness (#2850)

* feat: add a restricted and supervised Claude Code runner

Preserve configured authentication and models while enforcing tool access, strict completion JSON, bounded output and process cleanup. Cover argv, failure handling, session metadata and Windows process containment.

* feat: route outside reviews by harness and migrate wrapper installs

Use Claude Code from Codex and Codex from other supported hosts, with shared invocation rendering, positive gate validation and per-phase provenance. Rename /claude to /claude-code, repair managed shared and copied installations safely, and generate native Kiro skills. Add installed-workflow, failure-injection and live cross-harness regression coverage.

* test: recognize CEO mode labels without terminal spacing

The paid workflow rendered SCOPEEXPANSION at option 4, but its driver required a literal space. Match the leading mode title without cursor-spacing artifacts and ignore adjacent preview text. Preserve missing-target failures and downstream posture assertions.

* test: isolate plan-count fixtures before starting review workflows

Seed the complete test plan in a private git repository before launching Claude, so a bare slash command cannot review the live workspace while a delayed fixture message remains queued. Preserve count thresholds, parsers and budgets. Add initial-context and installed-discovery tests, and retain startup/terminal diagnostics on failed evaluations.

* test: stabilize review fixtures and Claude eval startup

Preserve source boundaries in workflow judge inputs, isolate CEO mode plans, and wait for interactive trust input readiness. Keep startup failure evidence and retain existing models, budgets, and assertions.

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* test: classify collapsed review modes and isolate seeded findings

Keep review questions out of the setup count when terminal cursor positioning removes spaces. State existing webhook safeguards so the five-finding control measures its seeded defects without accidental extra security and concurrency gaps. Preserve question bands and the paired control.

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* test: isolate browser daemon state across free shards

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* test: stabilize native review counting and interactive navigation

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* chore: prepare v1.82.0.0 release

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* fix: eliminate browser and process-cleanup test flakes

Pin every CI surface to Bun 1.4.0 to avoid extra-stdio finalizers closing
reused live sockets. Add an isolated GC/listener regression that fails on
Bun 1.3.13, and prevent coordinated rollback to an affected CI runtime.

Check renderer cleanup against the render's own staging directory so
concurrent renders cannot invalidate the assertion. Make the no-pgrep
process-tree walk tolerate disappearing /proc entries, and synchronize
its test fixture through child readiness and pipe EOF instead of sleeps.

Validation: 9,157 passed, 31 skipped, zero failures across 556 files with
retries disabled. Build, all-host generation freshness, and skill checks
passed. All three races have failing-before/passing-after regressions.

* fix: count completed native review questions in evals

* fix: drive review navigation from confirmed native choices

* fix: require complete section-loading eval reports

* test: isolate telemetry HTTP transport from local assertions

* fix: keep review input on the active native question

* test: let tunnel revocation daemon choose an available port

* test: allocate available ports for pairing and watchdog fixtures

* fix: stabilize planning eval navigation and phase reporting

* test: isolate installed runtime paths in planning evals

* test: stabilize review evidence and concurrent refresh fixtures

* fix: resolve design findings before editing the plan

* fix: honor and persist disabled outside plan reviews

* fix: preserve planning decisions and terminal evidence

Load installed host reviews at autoplan phase entry and wait for completed
reviewers and saved artifacts. Reuse approved remedies while preserving
individual finding decisions.

Drive interactive evals from the current terminal viewport, bind native
questions across scrolling, and require complete native report evidence.
Cover captured stale menus, permission lifecycles, setup classification,
and disabled-review tool availability with deterministic regressions.

Advance release metadata and the upgrade migration to the unclaimed
1.83.0.0 slot.

* fix: drive native review questions and preserve current plans

Use the native single-choice keyboard protocol and current terminal viewport,
with per-question navigation inside packets and completed-call coverage.
Keep permissions, multi-select menus, and Submit controls distinct.

Send Autoplan reviewers the amended implementation plan, keep its review record
separate, and supply retained application contracts in the chain fixture.
Clarify individual DevEx decisions and complete CEO fix options; use one active
plan destination for the section-loading report.

* fix: preserve complete plan-review decisions

* fix: recognize native plan dialogs and reviewer controls

* fix: preserve review decisions and phase completion

* fix: recognize completed reviews without losing findings

* fix: preserve review continuity and native eval completion

* test: fix native review completion and eval retry isolation

* test: handle native review menus and complete eval fixtures

* test: fix native review setup, completion, and isolation failures

* test: limit native skill discovery to runtime assets

* fix: bind Autoplan reviews to full ordered phase inputs

* test: fix planning eval routing, counting, and timeout handling

* chore: advance queued release to v1.84.0.0

* fix: preserve complete review inputs and planning decisions

* fix: reconcile review approvals and preserve phase obligations

* fix: preserve review obligations and unblock eval permissions

Carry recorded Autoplan requirements into blind phase inputs, require Eng
review approvals before exit, and exercise combined asynchronous flows in
CEO reviews. Correct native finding and handoff classification and unblock
repeated report edits using scoped request identities.

* fix: retain plan requirements and complete native review dialogs

* fix: complete native review prompts and retain plan references

* fix: preserve review inputs and classify native eval evidence

* fix: check competing completion orders in CEO reviews

* fix: recognize review decisions and require phase methodology

Require the current phase methodology before Autoplan snapshots. Correct
substantive decision, closed handoff, and cache-finding classification, and
honor the recommended implementation approach in native review dialogs.

Add captured-transcript regressions without changing review thresholds,
provider models, retries, or deadlines.

* test: bind native review decisions and close completed handoffs

* fix: complete review dialogs and verify methodology delivery

* fix: preserve review evidence and unblock native eval prompts

* fix: handle native review question completions

* fix: recognize native review narration and controls

* fix: count native review decisions and isolate eval fixtures

* test: verify seeded review coverage and current artifact permissions

* test: isolate model and brain-aware skill renders

* fix: repair native workflow evaluation and clarify review steps

* fix: stabilize workflow eval evidence and review guidance

* test: repair native workflow observation and fixture isolation

* fix: recognize completed workflow evidence and owned skill reads

* test: repair seeded workflow delivery and completion evidence

* test: recognize current review evidence across native forms

* test: handle native review variants and permission redraws

* fix: honor review preferences and recognize native eval evidence

* test: recognize completed review decisions and queued permissions

* test: match current review contracts and partial-line edits

* test: recognize completed workflow evidence and bounded human waits

* fix: preserve review entry gates and native eval interactions

* fix: recognize native workflow evidence and preserve review gates

* test: recognize current review evidence and preconfigure workflow fixtures

* test: recognize completed review findings and scoped artifact permissions

* fix: stabilize native workflow review and permission evidence

* fix: recognize current review evidence and scoped edit confirmations

Clarify Design and engineering review entry instructions and Design scoring.
Recognize required legacy coverage and public Autoplan completion recaps.
Bind the pending Edit confirmation to its exact file, ordered digest, and
one-request approval when a preceding command display remains visible.
Keep reviews within their existing size limits and preserve scope gates
when extracting workflow fixtures from either supported preamble header.

Keep failure outcomes, review thresholds, provider choices, and eval budgets.

* fix: recover review workflow progress and eval evidence

* fix: recognize valid review evidence and scope selection

* test: fix review evidence parsing and repeated artifact prompts

* test: recognize valid review decisions and pending native cards

* fix(plan-eng-review): keep final navigation consistent with approved tasks

* test: recognize valid review evidence and bind legacy diff requests

* fix: stabilize review eval evidence and harness repair guidance

* docs: update project documentation for v1.85.0.0

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* test: fix Windows CI fixtures and credential scan

Rebase captured JSON values and filesystem evidence using the appropriate
path convention. Compile native fake CLIs on Windows and synchronize pipe
holder readiness, with cleanup retained when assertions fail.

Assemble synthetic credential fixtures at runtime so the added-line scan
keeps enforcing the same gate without flagging its own rejection controls.

Discover generated skills directly for the empty-find regression check,
avoiding a recursive scan through saved evaluation artifacts and dependencies.

* fix: preserve source renders on Windows

Compare canonical generator paths using native separators so an output
sidecar pointing at the source cannot overwrite its skill or metadata.
Keep the regression fixture isolated from the real checkout and expose
freshness diagnostics before asserting subprocess status.

Detach Windows drain-test pipe holders from the fake provider's automatic
child cleanup while preserving the enclosing runner job and its assertions.

* fix: clarify outside review fallback and CEO decisions

Render one applicable own-harness fallback path and retain native review,
disabled policy, and missing-coverage semantics. Align report field names
and mode labels, and make the existing per-cut scope approval explicit.

Regenerate skill outputs and keep the workflow judge's model, thresholds,
and retry policy unchanged.

* chore: move release to free version slot (v1.86.0.0)

PR #2852 now claims v1.85.0.0. Align the release metadata and
rename migration so upgrades from that version still receive it.

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* fix: include engineering review prerequisites and restore branch context

* fix: recognize coverage diagrams and clarify design review instructions

* fix: preserve file identities and join Windows test processes

---------

Co-authored-by: OpenAI Codex <noreply@openai.com>
This commit is contained in:
Garry Tan
2026-09-14 14:32:45 -07:00
committed by GitHub
co-authored by OpenAI Codex
parent 71f6048e8a
commit 9f81911136
767 changed files with 127420 additions and 3917 deletions
+174 -65
View File
@@ -28,6 +28,16 @@ function readShipUnion(): string {
return readSkillUnion('ship');
}
function readExternalSkillUnion(output: string, hostSubdir: string, skill: string): string {
const dir = path.join(output, hostSubdir, 'skills', `gstack-${skill}`);
const sections = path.join(dir, 'sections');
return fs.readFileSync(path.join(dir, 'SKILL.md'), 'utf-8')
+ (fs.existsSync(sections) ? fs.readdirSync(sections).sort()
.filter(file => file.endsWith('.md'))
.map(file => '\n' + fs.readFileSync(path.join(sections, file), 'utf-8')).join('') : '');
}
// Token-reduction Phase 1: the preamble's inline bash (session bookkeeping,
// config echoes, telemetry producers, artifacts sync) moved into
// bin/gstack-skill-start / bin/gstack-skill-end. The render carries a one-line
@@ -114,10 +124,8 @@ const ALL_SKILLS = (() => {
return skills;
})();
// hosts/claude.ts generation.skipSkills entries would filter here; the set is
// currently empty (the /claude outside-voice template was removed).
// The claude host deliberately skips some skills (skipSkills — e.g. the
// /claude outside-voice skill exists only for non-Claude hosts), so those
// /claude-code outside-voice skill exists only for non-Claude hosts), so those
// dirs have a SKILL.md.tmpl but no generated claude-host SKILL.md on a fresh
// checkout. Every generated-file assertion must exclude them or it is red on
// every clean clone (it was, invisibly, until the free suite ran in CI).
@@ -1410,7 +1418,7 @@ describe('DESIGN_SKETCH resolver', () => {
describe('CODEX_SECOND_OPINION resolver', () => {
const content = readSkillUnion('office-hours'); // carved: Phase 5/6 prose moved to section
const codexContent = fs.readFileSync(path.join(EXTERNAL_OUT, '.agents', 'skills', 'gstack-office-hours', 'SKILL.md'), 'utf-8');
const codexContent = readExternalSkillUnion(EXTERNAL_OUT, '.agents', 'office-hours');
test('Phase 3.5 section appears in office-hours SKILL.md', () => {
expect(content).toContain('Phase 3.5: Cross-Model Second Opinion');
@@ -1430,7 +1438,8 @@ describe('CODEX_SECOND_OPINION resolver', () => {
});
test('contains Claude subagent fallback', () => {
expect(content).toContain('CODEX_NOT_AVAILABLE');
expect(content).toContain('CODEX_MODE: not_installed');
expect(content).toContain('If preflight is not ready');
expect(content).toContain('Agent tool');
expect(content).toContain('SECOND OPINION (Claude subagent)');
});
@@ -1445,14 +1454,11 @@ describe('CODEX_SECOND_OPINION resolver', () => {
expect(content).toMatch(/[Ee]mpty response/);
});
test('Codex host variant does NOT contain the Phase 3.5 resolver output', () => {
// The resolver returns '' for codex host, so the interactive section is stripped.
// Static template references to "Phase 3.5" in prose/conditionals are fine.
// Other resolvers (design review lite) may contain CODEX_NOT_AVAILABLE, so we
// check for Phase 3.5-specific markers only.
expect(codexContent).not.toContain('Phase 3.5: Cross-Model Second Opinion');
expect(codexContent).not.toContain('TMPERR_OH');
expect(codexContent).not.toContain('gstack-codex-oh-');
test('Codex host runs Phase 3.5 through Claude Code', () => {
expect(codexContent).toContain('Phase 3.5: Cross-Model Second Opinion');
expect(codexContent).toContain('gstack-claude-code');
expect(codexContent).toContain('Claude Code');
expect(codexContent).not.toMatch(/codex\s+(?:exec|review)\s/);
});
});
@@ -1740,7 +1746,7 @@ describe('DESIGN_OUTSIDE_VOICES resolver', () => {
test('plan-design-review contains outside voices section', () => {
const content = readSkillUnion('plan-design-review');
expect(content).toContain('Design Outside Voices');
expect(content).toContain('CODEX_AVAILABLE');
expect(content).toContain('CODEX_MODE: ready');
expect(content).toContain('LITMUS SCORECARD');
});
@@ -1873,6 +1879,107 @@ describe('DESIGN_HARD_RULES resolver', () => {
});
});
describe('Design approval reconciliation', () => {
test('token alignment reuses the approved outcome while preserving first decisions and new tradeoffs', () => {
const section = fs.readFileSync(path.join(ROOT, 'plan-design-review/sections/review-sections.md'), 'utf8');
const pass = extractMarkdownSection(section, '### Pass 5: Design System Alignment');
const stop = pass.indexOf('**STOP.**');
expect(stop).toBeGreaterThan(0);
const beforeQuestion = pass.slice(0, stop);
expect(beforeQuestion).toContain('check whether an earlier pass already approved that outcome');
expect(beforeQuestion).toContain('apply the established tokens and update every stale gap/reference under that decision');
expect(beforeQuestion).toContain('changing the plan location or spelling out the same fix is not a new issue');
expect(beforeQuestion).toContain('Ask again only if new evidence exposes an unresolved requirement or tradeoff, and name it');
expect(beforeQuestion).toContain('An unapproved violation still needs its first individual decision');
expect(pass.slice(stop)).toContain('AskUserQuestion once per issue. Do NOT batch. Recommend + WHY.');
});
test('loaded review section distinguishes individual issue decisions from navigation', () => {
const section = fs.readFileSync(path.join(ROOT, 'plan-design-review/sections/review-sections.md'), 'utf8');
expect(section).toContain('Complete one decision cycle per unresolved finding');
expect(section).toContain('Scope, focus, setup, and next-step choices approve no remedies.');
expect(section).toContain('Never use the final next-step AskUserQuestion to satisfy the issue-approval loop.');
expect(section).toContain('With no unresolved findings, no issue question is required.');
});
test('Design blocking Exit checklist reconciles approvals and refreshes stale output after a decision', () => {
const main = fs.readFileSync(path.join(ROOT, 'plan-design-review/SKILL.md'), 'utf8');
const check = extractMarkdownSection(main, '## Section self-check');
expect(check).toContain('Before summaries, review logs or next-step menus, run approval check 0 below.');
const gate = extractMarkdownSection(main, '## EXIT PLAN MODE GATE (BLOCKING)');
expect(gate.indexOf('0. Approvals:')).toBeGreaterThanOrEqual(0);
expect(gate.indexOf('0. Approvals:')).toBeLessThan(gate.indexOf('1. Read the plan file'));
expect(gate).toContain("each issue's remedy needs its own AskUserQuestion call and answer.");
expect(gate).toContain("Never group distinct issues.");
expect(gate).toContain('Never group distinct issues. DESIGN.md tokens and navigation are not approval.');
expect(gate).toContain('Honor prior exact decisions and preamble-authorized per-issue auto-decisions;');
expect(gate).toContain('preamble-authorized');
expect(gate).toContain('record why. Deferrals remain unresolved.');
expect(gate).toContain('If missing, reset drafts to pending, ask and wait.');
expect(gate).toContain('refresh the plan, report and review log; rerun this gate.');
expect(gate).toContain('after your most recent write to it');
});
test('CEO blocking Exit checklist rejects setup and approach as issue approval', () => {
const main = fs.readFileSync(path.join(ROOT, 'plan-ceo-review/SKILL.md'), 'utf8');
const check = extractMarkdownSection(main, '## Section self-check');
expect(check).toContain('Before summaries, review logs or next-step menus, run approval check 0 below.');
const gate = extractMarkdownSection(main, '## EXIT PLAN MODE GATE (BLOCKING)');
expect(gate.indexOf('0. Approvals:')).toBeGreaterThanOrEqual(0);
expect(gate.indexOf('0. Approvals:')).toBeLessThan(gate.indexOf('1. Read the plan file'));
expect(gate).toContain("each issue's remedy needs its own AskUserQuestion call and answer.");
expect(gate).toContain("Never group distinct issues.");
expect(gate).toContain('Never group distinct issues. Setup, mode, approach and navigation are not approval.');
expect(gate).toContain('Honor prior exact decisions and preamble-authorized per-issue auto-decisions;');
expect(gate).toContain('preamble-authorized');
expect(gate).toContain('record why. Deferrals remain unresolved.');
expect(gate).toContain('If missing, reset drafts to pending, ask and wait.');
expect(gate).toContain('refresh the plan, report and review log; rerun this gate.');
expect(check).toContain('Read and execute every section and output');
expect(check).toContain('STOP, Read it and redo the review');
expect(main).toContain('one tool_use per issue, no batching');
expect(main).toContain('even obvious fixes');
expect(main).toContain('wait for approval before changing the plan');
expect(main).toContain('Zero findings: state "No issues, moving on"');
});
test('Eng cannot exit with unasked findings listed only in an unresolved-decisions report', () => {
const main = fs.readFileSync(path.join(ROOT, 'plan-eng-review/SKILL.md'), 'utf8');
const check = extractMarkdownSection(main, '## Section self-check');
expect(check).toContain('Before summaries, review logs or next-step menus, run approval check 0 below.');
const gate = extractMarkdownSection(main, '## EXIT PLAN MODE GATE (BLOCKING)');
expect(gate.indexOf('0. Approvals:')).toBeGreaterThanOrEqual(0);
expect(gate.indexOf('0. Approvals:')).toBeLessThan(gate.indexOf('1. Read the plan file'));
expect(gate).toContain("each issue's remedy needs its own AskUserQuestion call and answer.");
expect(gate).toContain('Never group distinct issues. Setup, mode, approach and navigation are not approval.');
expect(gate).toContain('Honor prior exact decisions and preamble-authorized per-issue auto-decisions;');
expect(gate).toContain('record why. Deferrals remain unresolved.');
expect(gate).toContain('The coverage-audit REGRESSION test is already authorized; cite that rule.');
expect(gate).toContain('This exception covers only the regression test, not other findings.');
expect(gate).toContain('If missing, reset drafts to pending, ask and wait.');
expect(gate).toContain('refresh the plan, report and review log; rerun this gate.');
});
test('approval entry does not alter other review Exit checklists', () => {
for (const skill of ['plan-devex-review']) {
const gate = extractMarkdownSection(readSkillUnion(skill), '## EXIT PLAN MODE GATE (BLOCKING)');
expect(gate).not.toContain('0. Approvals:');
expect(gate).toContain('1. Read the plan file');
expect(gate).toContain('5. If a plan file is in context');
}
});
test('task and decision reporting require approval while preserving unanswered findings', () => {
const section = fs.readFileSync(path.join(ROOT, 'plan-design-review/sections/review-sections.md'), 'utf8');
const reconcile = section.indexOf('Before synthesizing tasks or the completion summary');
expect(reconcile).toBeGreaterThan(0);
expect(reconcile).toBeLessThan(section.indexOf('## Implementation Tasks'));
expect(section).toContain('Export only agreed implementation work; retain unapproved remedies as pending findings.');
expect(section).toContain('Count only individually approved new decisions');
expect(section).toContain('including a finding not yet asked');
});
});
// --- {{DESIGN_DETECTOR}} resolver tests ---
describe('DESIGN_DETECTOR resolver', () => {
@@ -2184,10 +2291,13 @@ describe('Codex generation (--host codex)', () => {
}
});
test('no ~/.claude/ paths in Codex output', () => {
test('no ~/.claude/ runtime paths in Codex output', () => {
for (const skill of CODEX_SKILLS) {
const content = fs.readFileSync(path.join(AGENTS_DIR, skill.codexName, 'SKILL.md'), 'utf-8');
expect(content).not.toContain('~/.claude/');
// Outside prompts may explicitly forbid reading Claude's skill directory.
// Every executable/runtime path must still use the selected host root.
const withoutBoundary = content.replace(/^.*IMPORTANT: Do NOT read or execute[^\n]*$/gm, '');
expect(withoutBoundary).not.toContain('~/.claude/');
}
});
@@ -2196,53 +2306,28 @@ describe('Codex generation (--host codex)', () => {
expect(fs.existsSync(path.join(AGENTS_DIR, 'gstack-codex'))).toBe(false);
});
test('Codex output includes Claude outside-voice skill with read-only boundary', () => {
const content = fs.readFileSync(path.join(AGENTS_DIR, 'gstack-claude', 'SKILL.md'), 'utf-8');
expect(content).toContain('claude -p');
expect(content).toContain('mktemp /tmp/gstack-claude-prompt-');
expect(content).toContain('mktemp /tmp/gstack-claude-response-XXXXXX');
expect(content).toContain('mktemp /tmp/gstack-claude-error-XXXXXX');
expect(content).toContain('mktemp /tmp/gstack-claude-diff-');
expect(content).not.toMatch(/gstack-claude-(?:prompt|response|error|diff)-X{6,}\.\w+/);
expect(content).not.toContain('/tmp/gstack-claude-diff-$$');
expect(content).toContain('cat "$PROMPT_FILE" | "$CLAUDE_BIN" -p');
expect(content).toContain('Resolve the binary and invoke it in the same host execution context');
expect(content).toContain('--disable-slash-commands');
expect(content).toContain('--tools ""');
expect(content).toContain('--allowedTools Read,Grep,Glob');
expect(content).toContain('--disallowedTools Bash,Edit,Write');
expect(content).toContain('Do not infer authentication state from credential files');
expect(content).toContain('run the actual `claude -p`');
expect(content).not.toContain('AUTH_MISSING');
test('Codex output includes the renamed Claude Code skill and restricted runner', () => {
const content = readExternalSkillUnion(EXTERNAL_OUT, '.agents', 'claude-code');
expect(content).toContain('name: claude-code');
expect(content).toContain('gstack-claude-code');
expect(content).toContain('--access none');
expect(content).toContain('--access read-only');
expect(content).toContain('--timeout-ms');
expect(content).toContain('claude-session-id');
expect(content).not.toContain('$HOME/.claude/.credentials.json');
expect(content).toContain('is_error');
expect(fs.existsSync(path.join(AGENTS_DIR, 'gstack-claude'))).toBe(false);
});
test('Claude temp file templates are accepted by host mktemp', () => {
for (const template of [
'/tmp/gstack-claude-prompt-XXXXXX',
'/tmp/gstack-claude-response-XXXXXX',
'/tmp/gstack-claude-error-XXXXXX',
'/tmp/gstack-claude-diff-XXXXXX',
]) {
const result = spawnSync('mktemp', [template], { encoding: 'utf-8', timeout: 30_000 });
expect(result.status).toBe(0);
const created = result.stdout.trim();
expect(created.startsWith(template.replace('XXXXXX', ''))).toBe(true);
fs.unlinkSync(created);
test('Codex ship and review preserve outside review through Claude Code', () => {
for (const skill of ['ship', 'review']) {
const content = readExternalSkillUnion(EXTERNAL_OUT, '.agents', skill);
expect(content).not.toMatch(/codex\s+(?:exec|review)\s/);
expect(content).toContain('gstack-claude-code');
expect(content).toContain('codex_reviews');
expect(content).toContain('adversarial-review');
}
});
test('Codex review step stripped from Codex-host ship and review', () => {
const shipContent = fs.readFileSync(path.join(AGENTS_DIR, 'gstack-ship', 'SKILL.md'), 'utf-8');
expect(shipContent).not.toContain('codex review --base');
expect(shipContent).not.toContain('CODEX_REVIEWS');
const reviewContent = fs.readFileSync(path.join(AGENTS_DIR, 'gstack-review', 'SKILL.md'), 'utf-8');
expect(reviewContent).not.toContain('codex review --base');
expect(reviewContent).not.toContain('CODEX_REVIEWS');
});
test('--host codex --dry-run freshness', () => {
// Dry-run against the out-dir render: determinism/idempotency check
// (regenerating produces the same bytes the module-level render did).
@@ -2464,9 +2549,10 @@ describe('Codex generation (--host codex)', () => {
// ─── Design outside voices: Codex host guard ─────────────────
test('codex host produces empty outside voices in design-review', () => {
const codexContent = fs.readFileSync(path.join(AGENTS_DIR, 'gstack-design-review', 'SKILL.md'), 'utf-8');
expect(codexContent).not.toContain('Design Outside Voices');
test('codex host retains design outside voices through Claude Code', () => {
const codexContent = readExternalSkillUnion(EXTERNAL_OUT, '.agents', 'design-review');
expect(codexContent).toContain('Design Outside Voices');
expect(codexContent).toContain('gstack-claude-code');
});
test('codex host does not include Codex design block in ship', () => {
@@ -2586,9 +2672,10 @@ describe('Factory generation (--host factory)', () => {
}
});
test('/codex skill excluded from Factory output', () => {
expect(fs.existsSync(path.join(FACTORY_DIR, 'gstack-codex', 'SKILL.md'))).toBe(false);
expect(fs.existsSync(path.join(FACTORY_DIR, 'gstack-codex'))).toBe(false);
test('Factory installs both outside-review wrapper skills', () => {
for (const skill of ['gstack-codex', 'gstack-claude-code']) {
expect(fs.existsSync(path.join(FACTORY_DIR, skill, 'SKILL.md'))).toBe(true);
}
});
test('Factory keeps Codex integration blocks', () => {
@@ -2896,11 +2983,13 @@ describe('setup script validation', () => {
expect(content).toContain('$GSTACK_BIN/');
});
test('setup supports --host kiro with install section and sed rewrites', () => {
test('setup installs Kiro-native output and runtime assets', () => {
expect(setupContent).toContain('INSTALL_KIRO=');
expect(setupContent).toContain('kiro-cli');
expect(setupContent).toContain('KIRO_SKILLS=');
expect(setupContent).toContain('~/.kiro/skills/gstack');
expect(setupContent).toContain('KIRO_SKILLS="$HOME/.kiro/skills"');
expect(setupContent).toContain('KIRO_DIR="$SOURCE_GSTACK_DIR/.kiro/skills"');
expect(setupContent).toContain('gen:skill-docs --host kiro');
expect(setupContent).toContain('$KIRO_GSTACK/lib');
});
@@ -3694,6 +3783,26 @@ describe('voice-triggers processing', () => {
});
});
describe('CEO accepted requirement preservation', () => {
test('HOLD SCOPE includes implementation work needed to meet accepted requirements', () => {
const main = fs.readFileSync(path.join(ROOT, 'plan-ceo-review/SKILL.md'), 'utf8');
const hold = main.slice(main.indexOf('**For HOLD SCOPE**'), main.indexOf('**For SCOPE REDUCTION**'));
expect(hold).toContain('Keep stated invariants and acceptance criteria; repairs needed to meet them are in scope.');
});
test('loaded sections keep requirement conflicts unresolved until an authorized decision', () => {
const section = fs.readFileSync(path.join(ROOT, 'plan-ceo-review/sections/review-sections.md'), 'utf8');
const policy = section.slice(section.indexOf('**Preserve accepted requirements.**'), section.indexOf('### Section 1:'));
expect(policy).toContain('report an implementation\ngap and propose a remedy that meets the requirement');
expect(policy).toContain('it does not authorize weakening the required behavior');
expect(policy).toContain('changing a test to expect the prohibited result');
expect(policy).toContain('keep that proposal pending and the original gap unresolved');
expect(policy).toContain('Earlier explicitly approved requirement changes and explicit authority to change\nthat scope remain valid');
expect(policy).toContain('Routine auto-decide permission alone cannot override an\nexplicit user constraint or non-goal');
expect(policy).toContain('Preserve the distinction in findings, tasks,\nand the completion report');
});
});
describe('plan-mode-info resolver (handshake-replacement)', () => {
const REVIEW_SKILLS = [
'plan-ceo-review',