From 6fbf32a3b98bd2e44176bd132f0a87a8d201c240 Mon Sep 17 00:00:00 2001 From: garrytan Date: Tue, 3 Nov 2026 20:23:46 +0000 Subject: [PATCH] after-pin: default skill_contracts on (#3939) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- changelog.d/capy-gst-1088-flip-contracts.md | 1 + lib/skill-route.ts | 2 +- test/setup-skill-hooks-gate.test.ts | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelog.d/capy-gst-1088-flip-contracts.md diff --git a/changelog.d/capy-gst-1088-flip-contracts.md b/changelog.d/capy-gst-1088-flip-contracts.md new file mode 100644 index 000000000..f94b8ce18 --- /dev/null +++ b/changelog.d/capy-gst-1088-flip-contracts.md @@ -0,0 +1 @@ +The skill contract check is now on by default (GST-1088): when a skill with a contract block ends without its required outputs, the Stop hook blocks once and names what is missing. Turn it off with `gstack-config set skill_contracts off` or `./setup --no-skill-contracts`. diff --git a/lib/skill-route.ts b/lib/skill-route.ts index 71356716d..1d88d04ee 100644 --- a/lib/skill-route.ts +++ b/lib/skill-route.ts @@ -37,7 +37,7 @@ export const SWITCH_ENV: Record = { /** Each switch's one default. setup, gstack-config and gstack-skill-route read it through `gstack-skill-route --default `; the hooks read it here. */ export const SWITCH_DEFAULT: Record = { skill_routing: 'on', - skill_contracts: 'off', + skill_contracts: 'on', }; export function normalizeSwitch(raw: string | null | undefined): 'on' | 'off' | null { diff --git a/test/setup-skill-hooks-gate.test.ts b/test/setup-skill-hooks-gate.test.ts index 979003bb8..20c72ef8a 100644 --- a/test/setup-skill-hooks-gate.test.ts +++ b/test/setup-skill-hooks-gate.test.ts @@ -194,9 +194,9 @@ describe('SWITCH_DEFAULT is the one default (a flip PR changes one line)', () => expect(SWITCH_DEFAULT.skill_routing).toBe('on'); }); - test('pin: skill_contracts defaults to off today (a flip PR changes lib/skill-route.ts line 40 and this pin)', () => { - expect(original.split('\n')[39]).toBe(" skill_contracts: 'off',"); - expect(SWITCH_DEFAULT.skill_contracts).toBe('off'); + test('pin: skill_contracts defaults to on today (a flip PR changes lib/skill-route.ts line 40 and this pin)', () => { + expect(original.split('\n')[39]).toBe(" skill_contracts: 'on',"); + expect(SWITCH_DEFAULT.skill_contracts).toBe('on'); }); test('every reader agrees with SWITCH_DEFAULT: gstack-config, setup, the routing hook and the Stop hook', () => {