mirror of
https://github.com/garrytan/gstack.git
synced 2026-06-20 08:40:11 +02:00
261d57a8e3
ship/SKILL.md drops 167KB → 68.7KB (~59% of the always-loaded skill) by moving
8 prose-heavy steps into ship/sections/*.md, read on demand:
tests, test-coverage, plan-completion, review-army, greptile, adversarial,
changelog, pr-body. Step 12's version logic now calls the tested
gstack-version-bump CLI instead of inline bash.
Claude-first (S2): {{SECTION:id}} emits a STOP-Read pointer on Claude (skeleton +
generated section files) and INLINES the content on every other host, so external
hosts keep the full monolith — verified factory at 162KB with no sections dir.
{{SECTION_INDEX:ship}} renders the situation→section table from the PASSIVE
manifest (CM2 / v2_PLAN.md:663); required-reads live only in test fixtures.
Multi-pass resolve expands inlined sections' own resolvers.
Parity: ship invariant flipped to sectioned (union content checks + maxSkeletonBytes
asserts the shrink). Carve-fallout fixed across gen-skill-docs/skill-validation/
golden/plan-completion/#1539/size-budget tests via skeleton+sections union reads.
Free suite green except the pre-existing investigate parity drift.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
52 lines
2.1 KiB
TypeScript
52 lines
2.1 KiB
TypeScript
import { describe, test, expect } from 'bun:test';
|
|
import * as fs from 'fs';
|
|
import * as path from 'path';
|
|
|
|
const SHIP_DIR = path.join(__dirname, '..', 'ship');
|
|
|
|
// Carved (v2 plan T9): the Plan Completion gate moved into sections/plan-completion.md.
|
|
// Read the skeleton + sections union so these invariants follow the content.
|
|
function readShipUnion(): string {
|
|
let t = fs.readFileSync(path.join(SHIP_DIR, 'SKILL.md'), 'utf8');
|
|
const secDir = path.join(SHIP_DIR, 'sections');
|
|
if (fs.existsSync(secDir)) {
|
|
for (const f of fs.readdirSync(secDir).sort()) {
|
|
if (f.endsWith('.md')) t += '\n' + fs.readFileSync(path.join(secDir, f), 'utf8');
|
|
}
|
|
}
|
|
return t;
|
|
}
|
|
|
|
describe('ship/SKILL.md — Plan Completion gate invariants (VAS-449 remediation)', () => {
|
|
const skill = readShipUnion();
|
|
|
|
test('Path concreteness rule: filesystem-pathed items must be test -f checked', () => {
|
|
expect(skill).toContain('**Path concreteness rule.**');
|
|
expect(skill).toMatch(/concrete filesystem path/);
|
|
expect(skill).toMatch(/MUST be classified DONE or NOT DONE based on `\[ -f/);
|
|
});
|
|
|
|
test('Validator detection: project package.json validate-* scripts are auto-run', () => {
|
|
expect(skill).toContain('**Validator detection.**');
|
|
expect(skill).toMatch(/package\.json/);
|
|
expect(skill).toMatch(/validate-\*/);
|
|
});
|
|
|
|
test('Per-item UNVERIFIABLE confirmation: blanket-confirm is forbidden', () => {
|
|
expect(skill).toContain('**Per-item confirmation is mandatory.**');
|
|
expect(skill).toMatch(/Do NOT use a single AskUserQuestion to blanket-confirm/);
|
|
expect(skill).toMatch(/VAS-449/);
|
|
});
|
|
|
|
test('Subagent failure: fail-closed, not silent fail-open', () => {
|
|
expect(skill).not.toMatch(/Never block \/ship on subagent failure\.\s*$/m);
|
|
expect(skill).toMatch(/Silent fail-open is the failure shape that VAS-449 surfaced/);
|
|
expect(skill).toMatch(/Stop and fix the audit/);
|
|
});
|
|
|
|
test('CONTENT-SHAPE dispatch invokes validator before falling back to UNVERIFIABLE', () => {
|
|
expect(skill).toMatch(/CONTENT-SHAPE in another repo.*validator/s);
|
|
expect(skill).toMatch(/passing validator promotes the item from UNVERIFIABLE to DONE/);
|
|
});
|
|
});
|