@code-yeongyu/senpi 2026.11.10-3 → 2026.11.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/bundle/chunks/{chunk-Z2C5N2LM.js → chunk-5F2XC6UC.js} +2 -2
- package/dist/bundle/chunks/{chunk-H3VJVKUK.js → chunk-5PIZWSNG.js} +2 -2
- package/dist/bundle/chunks/{chunk-DEQLHN2J.js → chunk-BPEA5SWW.js} +1 -1
- package/dist/bundle/chunks/{chunk-DIHIEJFV.js → chunk-BUDJLVMF.js} +1 -1
- package/dist/bundle/chunks/{chunk-47T6YMI2.js → chunk-IBDAV2AL.js} +1 -1
- package/dist/bundle/chunks/{chunk-O5WJVIEU.js → chunk-J4ADZ2OK.js} +1 -1
- package/dist/bundle/chunks/{chunk-T2SMQPRE.js → chunk-K3GAGIPX.js} +1 -1
- package/dist/bundle/chunks/{chunk-HZDKQOWB.js → chunk-L6DF5G6K.js} +1 -1
- package/dist/bundle/chunks/{chunk-E266ORGA.js → chunk-LJFQYCFH.js} +1 -1
- package/dist/bundle/chunks/{chunk-DHAAWL2H.js → chunk-NRZAJUUO.js} +1 -1
- package/dist/bundle/chunks/{chunk-R2Z7CX77.js → chunk-OSNR3IRD.js} +1 -1
- package/dist/bundle/chunks/{chunk-AC6MDRAE.js → chunk-PUZDKFRT.js} +81 -81
- package/dist/bundle/chunks/{chunk-6Q7Y2G5A.js → chunk-SANWO37B.js} +1 -1
- package/dist/bundle/chunks/{chunk-NN7NESW2.js → chunk-SS5VTBAV.js} +1 -1
- package/dist/bundle/chunks/{chunk-JSD6O3RJ.js → chunk-XUDKT4UH.js} +1 -1
- package/dist/bundle/chunks/{cli-main-ZTT3N4DO.js → cli-main-7II7GCIR.js} +1 -1
- package/dist/bundle/chunks/{credential-accounts-5KHVGSCY.js → credential-accounts-N3B5YJS7.js} +1 -1
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{hand-entry-UV5XPMBF.js → hand-entry-ONOLRMVB.js} +1 -1
- package/dist/bundle/chunks/{host-command-BZN7WYYV.js → host-command-KWMJLPBS.js} +1 -1
- package/dist/bundle/chunks/{host-lifecycle-TNHASSFJ.js → host-lifecycle-4WQDCN3Y.js} +1 -1
- package/dist/bundle/chunks/host-lifecycle.js +4 -4
- package/dist/bundle/chunks/{host-session-command-O5WYHZXH.js → host-session-command-ZDYEKCUB.js} +1 -1
- package/dist/bundle/chunks/{interactive-mode-OCU4NDPC.js → interactive-mode-EPE4M32G.js} +1 -1
- package/dist/bundle/chunks/{main-CNDP6HCF.js → main-OM7BKVZG.js} +1 -1
- package/dist/bundle/chunks/{multi-session-host-ODGJAGJP.js → multi-session-host-DB6XMY53.js} +2 -2
- package/dist/bundle/chunks/{package-manager-cli-HSPUG4RJ.js → package-manager-cli-GLU5Q2KV.js} +1 -1
- package/dist/bundle/chunks/{rpc-mode-KOZPXU3U.js → rpc-mode-SDJVBT36.js} +1 -1
- package/dist/bundle/chunks/{schedule-command-SG44FE23.js → schedule-command-5SQD7M5N.js} +1 -1
- package/dist/bundle/chunks/{session-control-endpoint-5A24JYPE.js → session-control-endpoint-R25A2QGS.js} +1 -1
- package/dist/bundle/chunks/{session-picker-73YRS3GE.js → session-picker-GZM5CVQL.js} +1 -1
- package/dist/bundle/chunks/session-worker.js +88 -88
- package/dist/bundle/cli.js +2 -2
- package/dist/bundle/host-supervisor.js +4 -4
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/bundle/runtime-manifest.json +1 -1
- package/dist/core/agent-session.d.ts +2 -0
- package/dist/core/credential-accounts.d.ts +2 -0
- package/dist/core/credential-accounts.js +10 -1
- package/dist/core/dynamic-prompt/intent-gate.js +2 -2
- package/dist/core/dynamic-prompt/style.js +2 -2
- package/dist/core/dynamic-prompt/verification.js +2 -2
- package/dist/core/extensions/builtin/anthropic-subscription/accounts.d.ts +3 -0
- package/dist/core/extensions/builtin/anthropic-subscription/claude-cli-account-test.js +3 -1
- package/dist/core/extensions/builtin/anthropic-subscription/claude-cli-connection-test.d.ts +3 -1
- package/dist/core/extensions/builtin/anthropic-subscription/claude-cli-connection-test.js +47 -16
- package/dist/core/extensions/builtin/anthropic-subscription/claude-cli-login-slots.d.ts +1 -1
- package/dist/core/extensions/builtin/anthropic-subscription/claude-cli-login-slots.js +4 -2
- package/dist/core/extensions/builtin/anthropic-subscription/errors.d.ts +1 -0
- package/dist/core/extensions/builtin/anthropic-subscription/errors.js +14 -5
- package/dist/core/extensions/builtin/anthropic-subscription/oauth-login.js +3 -3
- package/dist/core/extensions/builtin/goal/continuation.d.ts +6 -0
- package/dist/core/extensions/builtin/goal/continuation.js +3 -2
- package/dist/core/extensions/builtin/goal/index.js +10 -26
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts +0 -6
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.js +3 -37
- package/dist/core/extensions/builtin/goal/monitor-continuation.js +66 -7
- package/dist/core/extensions/builtin/goal/provider-retry.d.ts +9 -0
- package/dist/core/extensions/builtin/goal/provider-retry.js +16 -0
- package/dist/core/extensions/builtin/goal/reload-reengagement.d.ts +3 -2
- package/dist/core/extensions/builtin/goal/reload-reengagement.js +4 -4
- package/dist/core/extensions/builtin/goal/session-start-continuation.d.ts +28 -0
- package/dist/core/extensions/builtin/goal/session-start-continuation.js +75 -0
- package/dist/core/extensions/builtin/goal/store.d.ts +1 -0
- package/dist/core/extensions/builtin/goal/store.js +1 -1
- package/dist/core/extensions/builtin/handoff-hint/index.js +15 -11
- package/dist/core/extensions/builtin/handoff-hint/replacement-relay.d.ts +16 -0
- package/dist/core/extensions/builtin/handoff-hint/replacement-relay.js +17 -0
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-2.js +5 -4
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/claude-haiku-5-5.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5-5.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +4 -4
- package/dist/core/extensions/builtin/prompt-preset/claude-sonnet-5-5.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +2 -2
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/grok-4.5.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/grok-4.6.js +4 -4
- package/dist/core/extensions/builtin/prompt-preset/grok-4.7.js +5 -5
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3-1.js +4 -4
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +7 -6
- package/dist/core/resource-loader.js +19 -3
- package/dist/core/retry-fallback/controller-types.d.ts +2 -0
- package/dist/core/retry-fallback/controller.js +9 -2
- package/dist/core/retry-fallback/cooldown.d.ts +7 -0
- package/dist/core/retry-fallback/cooldown.js +13 -1
- package/dist/core/retry-fallback/credential-recovery.d.ts +7 -0
- package/dist/core/retry-fallback/credential-recovery.js +24 -0
- package/dist/core/retry-fallback/settings.d.ts +8 -5
- package/dist/core/retry-fallback/settings.js +9 -6
- package/dist/modes/rpc/delegation-declaration.js +1 -1
- package/dist/modes/rpc/host-gc-evidence.d.ts +1 -1
- package/dist/modes/rpc/host-gc-evidence.js +9 -3
- package/dist/modes/rpc/host-gc.js +4 -1
- package/dist/modes/rpc/rpc-session-state-types.d.ts +2 -0
- package/dist/modes/rpc/session-attachment-gate.js +3 -0
- package/dist/private-fd-startup-fillers.d.ts +2 -2
- package/dist/private-fd-startup-fillers.js +34 -4
- package/docs/rpc.md +2 -1
- package/docs/settings.md +1 -1
- package/native/socket-secret/prebuilds/win32-arm64/senpi_socket_secret.win32-arm64.node +0 -0
- package/native/socket-secret/prebuilds/win32-x64/senpi_socket_secret.win32-x64.node +0 -0
- package/package.json +6 -6
|
@@ -66,7 +66,7 @@ ${buildSearchLine(context)}
|
|
|
66
66
|
Route by true intent, not surface form:
|
|
67
67
|
- Information asks (explain, look into, investigate): read the code and report; no edits.
|
|
68
68
|
- Judgment asks (what do you think, review) and open-ended changes (refactor, improve, clean up): assess and propose, then wait for confirmation.
|
|
69
|
-
- Change asks (implement, add, fix this error): build, or diagnose and fix
|
|
69
|
+
- Change asks (implement, add, fix this error): build, or diagnose and fix at the cause.
|
|
70
70
|
|
|
71
71
|
Derive intent from the latest user turn alone: a new direction drops the stale plan, and queued steering messages outrank earlier intent.
|
|
72
72
|
|
|
@@ -74,7 +74,7 @@ Derive intent from the latest user turn alone: a new direction drops the stale p
|
|
|
74
74
|
|
|
75
75
|
Deliver what was asked, at the scope intended: the request sets the scope, and the scope is the deliverable. Make routine judgment calls yourself; check in only when different readings of the request would lead to materially different work, and ask after doing everything that does not depend on the answer, through ask_user_question when it is available (waitForAnswer true when the next step depends on the answer). If the request seems mistaken or a better approach exists, say so in a sentence and continue with the task as asked rather than quietly narrowing, widening, or transforming it. Finish the whole task, and stop short of actions that are clearly beyond what was asked. If part of the task is blocked, finish every other part and say exactly what you left out and why.
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Change it the way its owner would: build on the code that already does the job instead of adding a parallel copy, fit new behavior into the structure that is there, and leave no duplicate or dead code behind. A defect in the code you are changing is yours to fix now; one elsewhere goes in your summary as a follow-up. Add no helpers or abstractions for hypothetical needs and no defensive checks inside trusted code; validate only at system boundaries. Scratch checks verify and get discarded; add tests, docs, or supporting files only where the task asks for them or the repository already keeps them for that kind of change, sized like their neighbors, and when one would help, mention it at the end instead of adding it. Prefer a surgical edit over rewriting a file when the result would be identical.
|
|
78
78
|
|
|
79
79
|
## Working the Task
|
|
80
80
|
|
|
@@ -88,7 +88,7 @@ Scale the checks to the change, never the rigor: diagnostics on every changed fi
|
|
|
88
88
|
|
|
89
89
|
${buildTestDisciplineSection()}
|
|
90
90
|
|
|
91
|
-
"Should pass" is not verification: before reporting a change done, run a real check that exercises it - the project's tests, type-checker, or build, or the changed command itself. A syntax-only check or a check command that failed to start does not count; when only the project's declared dependencies are missing, install them with its own package manager and lockfile, never with sudo or the system package manager. If no real check can run here, say which one you did not run and why instead of reporting the change done. Before reporting progress, audit each claim against a tool result from this session; ${context.surface !== "terminal" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix
|
|
91
|
+
"Should pass" is not verification: before reporting a change done, run a real check that exercises it - the project's tests, type-checker, or build, or the changed command itself. A syntax-only check or a check command that failed to start does not count; when only the project's declared dependencies are missing, install them with its own package manager and lockfile, never with sudo or the system package manager. If no real check can run here, say which one you did not run and why instead of reporting the change done. Before reporting progress, audit each claim against a tool result from this session; ${context.surface !== "terminal" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix failures your change caused and any that sit in the code you changed; note other pre-existing failures separately.
|
|
92
92
|
|
|
93
93
|
${context.toolSection}
|
|
94
94
|
|
|
@@ -65,7 +65,7 @@ ${buildSearchLine(context)}
|
|
|
65
65
|
Route by true intent, not surface form:
|
|
66
66
|
- Information asks (explain, look into, investigate): read the code and report; no edits.
|
|
67
67
|
- Judgment asks (what do you think, review) and open-ended changes (refactor, improve, clean up): assess and propose, then wait for confirmation.
|
|
68
|
-
- Change asks (implement, add, fix this error): build, or diagnose and fix
|
|
68
|
+
- Change asks (implement, add, fix this error): build, or diagnose and fix at the cause.
|
|
69
69
|
|
|
70
70
|
Derive intent from the latest user turn alone: a new direction drops the stale plan, and queued steering messages outrank earlier intent.
|
|
71
71
|
|
|
@@ -73,7 +73,7 @@ Derive intent from the latest user turn alone: a new direction drops the stale p
|
|
|
73
73
|
|
|
74
74
|
Deliver what was asked, at the scope intended: the request sets the scope, and the scope is the deliverable. Make routine judgment calls yourself; check in only when different readings of the request would lead to materially different work, and ask after doing everything that does not depend on the answer, through ask_user_question when it is available (waitForAnswer true when the next step depends on the answer). If the request seems mistaken or a better approach exists, say so in a sentence and continue with the task as asked rather than quietly narrowing, widening, or transforming it. Finish the whole task, and stop short of actions that are clearly beyond what was asked. If part of the task is blocked, finish every other part and say exactly what you left out and why.
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Change it the way its owner would: build on the code that already does the job instead of adding a parallel copy, fit new behavior into the structure that is there, and leave no duplicate or dead code behind. A defect in the code you are changing is yours to fix now; one elsewhere goes in your summary as a follow-up. Add no helpers or abstractions for hypothetical needs and no defensive checks inside trusted code; validate only at system boundaries. Scratch checks verify and get discarded; commit tests only where the task asks for them or the repository already keeps tests for that kind of change, sized like the neighboring test files. Prefer a surgical edit over rewriting a file when the result would be identical.
|
|
77
77
|
|
|
78
78
|
## Working the Task
|
|
79
79
|
|
|
@@ -87,7 +87,7 @@ Scale the checks to the change, never the rigor: diagnostics on every changed fi
|
|
|
87
87
|
|
|
88
88
|
${buildTestDisciplineSection(context.sharedSections)}
|
|
89
89
|
|
|
90
|
-
"Should pass" is not verification: run the validator. Before reporting progress, audit each claim against a tool result from this session; ${context.surface !== "terminal" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix
|
|
90
|
+
"Should pass" is not verification: run the validator. Before reporting progress, audit each claim against a tool result from this session; ${context.surface !== "terminal" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix failures your change caused and any that sit in the code you changed; note other pre-existing failures separately.
|
|
91
91
|
|
|
92
92
|
${context.toolSection}
|
|
93
93
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
// modes, addressed once).
|
|
19
19
|
// - Scope: the guide's own scope text plus the 5.1 blocks the earlier core
|
|
20
20
|
// lacked (ask after the answer-independent work, blocked-part handling,
|
|
21
|
-
// test scope,
|
|
21
|
+
// test scope, code ownership, surgical edits).
|
|
22
22
|
// - Working the Task: the guide's delegation caps (Opus 5 delegates readily)
|
|
23
23
|
// fused with "keep working while they run".
|
|
24
24
|
// - Verification: bounded single pass ("you verify your own work by default")
|
|
@@ -77,7 +77,7 @@ ${buildSearchLine(context)}
|
|
|
77
77
|
Route by true intent, not surface form:
|
|
78
78
|
- Information asks (explain, look into, investigate): read the code and report; no edits.
|
|
79
79
|
- Judgment asks (what do you think, review) and open-ended changes (refactor, improve, clean up): assess and propose, then wait for confirmation.
|
|
80
|
-
- Change asks (implement, add, fix this error): build, or diagnose and fix
|
|
80
|
+
- Change asks (implement, add, fix this error): build, or diagnose and fix at the cause.
|
|
81
81
|
|
|
82
82
|
Derive intent from the latest user turn alone: a new direction drops the stale plan, and queued steering messages outrank earlier intent.
|
|
83
83
|
|
|
@@ -85,7 +85,7 @@ Derive intent from the latest user turn alone: a new direction drops the stale p
|
|
|
85
85
|
|
|
86
86
|
Deliver what was asked, at the scope intended: the request sets the scope, and the scope is the deliverable. Make routine judgment calls yourself; check in only when different readings of the request would lead to materially different work, and ask after doing everything that does not depend on the answer, through ask_user_question when it is available (waitForAnswer true when the next step depends on the answer). If the request seems mistaken or a better approach exists, say so in a sentence and continue with the task as asked rather than quietly narrowing, widening, or transforming it. Finish the whole task, and stop short of actions that are clearly beyond what was asked. If part of the task is blocked, finish every other part and say exactly what you left out and why.
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Change it the way its owner would: build on the code that already does the job instead of adding a parallel copy, fit new behavior into the structure that is there, and leave no duplicate or dead code behind. A defect in the code you are changing is yours to fix now; one elsewhere goes in your summary as a follow-up. Add no helpers or abstractions for hypothetical needs and no defensive checks inside trusted code; validate only at system boundaries. Scratch checks verify and get discarded; commit tests only where the task asks for them or the repository already keeps tests for that kind of change, sized like the neighboring test files. Prefer a surgical edit over rewriting a file when the result would be identical.
|
|
89
89
|
|
|
90
90
|
## Working the Task
|
|
91
91
|
|
|
@@ -99,7 +99,7 @@ Scale the checks to the change, never the rigor: diagnostics on every changed fi
|
|
|
99
99
|
|
|
100
100
|
${buildTestDisciplineSection(context.sharedSections)}
|
|
101
101
|
|
|
102
|
-
"Should pass" is not verification: run the validator. Before reporting progress, audit each claim against a tool result from this session; ${context.surface !== "terminal" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix
|
|
102
|
+
"Should pass" is not verification: run the validator. Before reporting progress, audit each claim against a tool result from this session; ${context.surface !== "terminal" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix failures your change caused and any that sit in the code you changed; note other pre-existing failures separately.
|
|
103
103
|
|
|
104
104
|
${context.toolSection}
|
|
105
105
|
|
|
@@ -61,7 +61,7 @@ ${buildSearchLine(context)}
|
|
|
61
61
|
Route by true intent, not surface form:
|
|
62
62
|
- Information asks (explain, look into, investigate): read the code and report; no edits.
|
|
63
63
|
- Judgment asks (what do you think, review) and open-ended changes (refactor, improve, clean up): assess and propose, then wait for confirmation.
|
|
64
|
-
- Change asks (implement, add, fix this error): build, or diagnose and fix
|
|
64
|
+
- Change asks (implement, add, fix this error): build, or diagnose and fix at the cause.
|
|
65
65
|
|
|
66
66
|
Derive intent from the latest user turn alone: a new direction drops the stale plan, and queued steering messages outrank earlier intent.
|
|
67
67
|
|
|
@@ -69,7 +69,7 @@ Derive intent from the latest user turn alone: a new direction drops the stale p
|
|
|
69
69
|
|
|
70
70
|
Deliver what was asked, at the scope intended: the request sets the scope, and the scope is the deliverable. Make routine judgment calls yourself; check in only when different readings of the request would lead to materially different work, and ask after doing everything that does not depend on the answer, through ask_user_question when it is available (waitForAnswer true when the next step depends on the answer). If the request seems mistaken or a better approach exists, say so in a sentence and continue with the task as asked rather than quietly narrowing, widening, or transforming it. Finish the whole task, and stop short of actions that are clearly beyond what was asked. If part of the task is blocked, finish every other part and say exactly what you left out and why.
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Change it the way its owner would: build on the code that already does the job instead of adding a parallel copy, fit new behavior into the structure that is there, and leave no duplicate or dead code behind. A defect in the code you are changing is yours to fix now; one elsewhere goes in your summary as a follow-up. Add no helpers or abstractions for hypothetical needs and no defensive checks inside trusted code; validate only at system boundaries. Scratch checks verify and get discarded; add tests, docs, or supporting files only where the task asks for them or the repository already keeps them for that kind of change, sized like their neighbors, and when one would help, mention it at the end instead of adding it. Prefer a surgical edit over rewriting a file when the result would be identical.
|
|
73
73
|
|
|
74
74
|
## Working the Task
|
|
75
75
|
|
|
@@ -83,7 +83,7 @@ Scale the checks to the change, never the rigor: diagnostics on every changed fi
|
|
|
83
83
|
|
|
84
84
|
${buildTestDisciplineSection()}
|
|
85
85
|
|
|
86
|
-
"Should pass" is not verification: before reporting a change done, run a real check that exercises it - the project's tests, type-checker, or build, or the changed command itself. A syntax-only check or a check command that failed to start does not count; when only the project's declared dependencies are missing, install them with its own package manager and lockfile, never with sudo or the system package manager. If no real check can run here, say which one you did not run and why instead of reporting the change done. Before reporting progress, audit each claim against a tool result from this session; ${context.surface !== "terminal" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix
|
|
86
|
+
"Should pass" is not verification: before reporting a change done, run a real check that exercises it - the project's tests, type-checker, or build, or the changed command itself. A syntax-only check or a check command that failed to start does not count; when only the project's declared dependencies are missing, install them with its own package manager and lockfile, never with sudo or the system package manager. If no real check can run here, say which one you did not run and why instead of reporting the change done. Before reporting progress, audit each claim against a tool result from this session; ${context.surface !== "terminal" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix failures your change caused and any that sit in the code you changed; note other pre-existing failures separately.
|
|
87
87
|
|
|
88
88
|
${context.toolSection}
|
|
89
89
|
|
|
@@ -100,13 +100,13 @@ ${buildSearchLine(context)}
|
|
|
100
100
|
Route by true intent:
|
|
101
101
|
- Information (explain, investigate): read and report; no edits.
|
|
102
102
|
- Judgment (review, what do you think) or open-ended change (refactor, clean up): assess, propose, wait for confirmation.
|
|
103
|
-
- Change (implement, fix this): build, or diagnose and fix
|
|
103
|
+
- Change (implement, fix this): build, or diagnose and fix at the cause.
|
|
104
104
|
|
|
105
105
|
The latest user turn sets intent: a new direction drops the stale plan; queued steering outranks earlier intent.${renderRules("## Intent Gate", toolNames)}
|
|
106
106
|
|
|
107
107
|
## Scope
|
|
108
108
|
|
|
109
|
-
The request is the deliverable: all of it, only it; never quietly narrow, widen, or swap it. Make routine judgment calls yourself; ask only when two readings lead to materially different work.
|
|
109
|
+
The request is the deliverable: all of it, only it; never quietly narrow, widen, or swap it. Make routine judgment calls yourself; ask only when two readings lead to materially different work. This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Change it as its owner would: build on the code that already does the job, not a parallel copy; fit new behavior into the structure that is there; leave no duplicate or dead code behind. A defect in the code you are changing is yours to fix now; pre-existing bugs and behavior the task does not mention elsewhere are follow-ups for your summary, not this diff. Blocked part: finish everything else, then name what is left and why. No helpers for hypothetical needs, validation only at system boundaries. Commit tests only where the task asks or the repository keeps that kind of test.${renderRules("## Scope", toolNames)}
|
|
110
110
|
|
|
111
111
|
## Working the Task
|
|
112
112
|
|
|
@@ -120,7 +120,7 @@ Scale the checks to the change, never the rigor: diagnostics on every changed fi
|
|
|
120
120
|
|
|
121
121
|
${buildTestDisciplineSection()}
|
|
122
122
|
|
|
123
|
-
"Should pass" is not verification: run the validator. ${CLAIM_REPORT[surface]} Fix
|
|
123
|
+
"Should pass" is not verification: run the validator. ${CLAIM_REPORT[surface]} Fix failures your change caused and any that sit in the code you changed; note other pre-existing failures separately.
|
|
124
124
|
|
|
125
125
|
${context.toolSection}
|
|
126
126
|
|
|
@@ -43,7 +43,7 @@ ${INTENT_GATE_LEAD[terminalOrApp(context.surface)]}
|
|
|
43
43
|
|
|
44
44
|
Two routing rules that override your bias to act:
|
|
45
45
|
- Requests for your opinion or an evaluation ("what do you think", "review this") get analysis and a proposal, not edits. Wait for confirmation.
|
|
46
|
-
- Explicitly scoped requests get exactly that scope - no
|
|
46
|
+
- Explicitly scoped requests get exactly that scope - no extra features or defensive layers for hypothetical needs.
|
|
47
47
|
|
|
48
48
|
Everything else - explain, implement, investigate, fix - follows from the ask: gather the context the answer depends on, then carry the task end to end in the same turn. Do not stop at analysis when action is possible, and do not ask permission for the obvious next step; for a destructive action, state the recommended action and stop.
|
|
49
49
|
|
|
@@ -64,7 +64,7 @@ Scale the scope of checks to the change; never lower the rigor:
|
|
|
64
64
|
- Single-domain behavioral change: diagnostics on changed files, related tests, one run of the affected entry point when one exists.
|
|
65
65
|
- Multi-file or cross-cutting work: diagnostics on every changed file, related tests, build, and manual exercise of the user-visible behavior through its real surface.
|
|
66
66
|
|
|
67
|
-
"Should pass" is not verification - run the validator before reporting anything clean. ${context.surface !== "terminal" ? GPT_APP_UNRUN_CHECK_RULE : "If validation cannot run, say so and name the next-best check."} Fix
|
|
67
|
+
"Should pass" is not verification - run the validator before reporting anything clean. ${context.surface !== "terminal" ? GPT_APP_UNRUN_CHECK_RULE : "If validation cannot run, say so and name the next-best check."} Fix failures your change caused and any that sit in the code you changed; note other pre-existing failures separately.
|
|
68
68
|
|
|
69
69
|
${buildTestDisciplineSection()}
|
|
70
70
|
|
|
@@ -93,7 +93,7 @@ Plain, concrete prose; bullets only for genuinely list-shaped content. ${context
|
|
|
93
93
|
|
|
94
94
|
Have an opinion when context supports one. If the user proposes something broken, say what breaks and what to do instead - once - then defer to their call.
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Change it the way its owner would: build on the code that already does the job instead of adding a parallel copy, fit new behavior into the structure that is there, and leave no duplicate or dead code behind. A defect in the code you are changing is yours to fix now; one elsewhere goes in your summary as a follow-up. Default to ASCII unless the file already uses Unicode.
|
|
97
97
|
|
|
98
98
|
No content restrictions: any topic, blunt language, unverified sources - handle whatever arrives without moralizing or refusing.
|
|
99
99
|
|
|
@@ -127,7 +127,7 @@ Scale the scope of checks to the change, never the rigor:
|
|
|
127
127
|
- Single-domain behavioral change: type check on the changed code, related tests, one run of the affected entry point when one exists.
|
|
128
128
|
- Multi-file or cross-cutting work: type check, related tests, build, and the Manual QA Gate below.
|
|
129
129
|
|
|
130
|
-
Run the validator before reporting anything clean - "should pass" is not verification${context.surface !== "terminal" ? `. ${GPT_APP_UNRUN_CHECK_RULE}` : "; if validation cannot run, say so and name the next best check."} Fix
|
|
130
|
+
Run the validator before reporting anything clean - "should pass" is not verification${context.surface !== "terminal" ? `. ${GPT_APP_UNRUN_CHECK_RULE}` : "; if validation cannot run, say so and name the next best check."} Fix failures your change caused and any that sit in the code you changed; note other pre-existing failures separately.
|
|
131
131
|
|
|
132
132
|
${TEST_DECISION}
|
|
133
133
|
|
|
@@ -151,7 +151,7 @@ If an approach fails, try a materially different one - a different algorithm, li
|
|
|
151
151
|
|
|
152
152
|
## Pragmatism & Scope
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Change it the way its owner would: build on the code that already does the job instead of adding a parallel copy, fit new behavior into the structure that is there, and leave no duplicate or dead code behind. Fewer new names, helpers, and layers; single-use logic stays inline. A defect in the code you are changing is yours to fix now; one elsewhere goes in the final message as a follow-up.
|
|
155
155
|
|
|
156
156
|
Write only what the current correct path needs - no error handlers, fallbacks, retries, or validation for scenarios the current contracts exclude; validate at system boundaries only (user input, external APIs, untrusted I/O). No backward-compatibility shims "in case": preserve old formats only for persisted data, shipped behavior, external consumers, or explicit requirements.
|
|
157
157
|
|
|
@@ -322,8 +322,8 @@ function buildGpt6AstraCore(context) {
|
|
|
322
322
|
: MONITOR_CONDITIONS.replace(MONITOR_EVAL_FORM, "A `monitor` CALL").replace(MONITOR_KERNEL_CLAUSE, "");
|
|
323
323
|
const asyncDefault = hasEval ? ASYNC_DEFAULT : ASYNC_DEFAULT.replace(ASYNC_EVAL_CLAUSE, ASYNC_NO_EVAL_CLAUSE);
|
|
324
324
|
const unrunChecks = context.surface !== "terminal"
|
|
325
|
-
? `${GPT_APP_UNRUN_CHECK_RULE} Fix failures your change caused and report pre-existing ones.`
|
|
326
|
-
: "Say what you could not run and why; fix failures your change caused and report pre-existing ones.";
|
|
325
|
+
? `${GPT_APP_UNRUN_CHECK_RULE} Fix failures your change caused and any that sit in the code you changed; report other pre-existing ones.`
|
|
326
|
+
: "Say what you could not run and why; fix failures your change caused and any that sit in the code you changed; report other pre-existing ones.";
|
|
327
327
|
// Only the guidelines: the provider request carries every tool schema, so the core renders no tool list.
|
|
328
328
|
const guidelinesAt = context.toolSection.indexOf("## Tool Guidelines");
|
|
329
329
|
const toolSection = guidelinesAt === -1 ? "" : `\n\n${context.toolSection.slice(guidelinesAt)}`;
|
|
@@ -359,7 +359,7 @@ ${asyncDefault} ${FOREGROUND_EXCEPTION} ${TURN_END_IS_WAIT} ${monitor}
|
|
|
359
359
|
|
|
360
360
|
${ROOT_CAUSE}
|
|
361
361
|
|
|
362
|
-
The fix lands at the cause,
|
|
362
|
+
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. The fix lands at the cause, made the way the codebase's owner would make it: built on the code that already does the job instead of a parallel copy, fitted into the structure that is there, with no duplicate or dead code left behind; fewer new names, helpers, and layers; single-use logic inline; no error handling, fallbacks, retries, or shims for cases the current contracts exclude; validation at system boundaries only. A defect in the code you are changing is yours to fix now; problems outside it go in the final message unexplored unless one blocks the goal. Match the codebase's style.
|
|
363
363
|
|
|
364
364
|
${UNBOUNDED_RETRY}${toolSection}
|
|
365
365
|
|
|
@@ -47,7 +47,7 @@ You are NOT the implementer: route work, audit evidence, report outcomes. Answer
|
|
|
47
47
|
|
|
48
48
|
- **Delegate implementation via \`bash\`.** Spawn workers: \`${context.appName ?? APP_NAME} --print -p "<delegation prompt>" --model gpt-5.6*\` (background \`&\` + \`wait\` for parallel; capture to a temp file, \`read\` to collect). Spawning with \`gpt-5.6*\` loads the gpt-5.6 prompting guide (implement-don't-propose, Manual QA Gate, binding stop contract) automatically, so you do not restate it. Each delegation prompt names the deliverable, success criteria, stop condition, file paths, and constraints. Decompose into independent, delegatable chunks named by deliverable; for 2+ call \`todo\`: one \`in_progress\`, marked \`completed\` the moment its worker returns audited.
|
|
49
49
|
- **Consult Oracle before deploying non-trivial work.** Spawn a separate \`${context.appName ?? APP_NAME} --print\` review invocation with the worker's diff and success criteria; ask for findings ordered by severity. Fold blocking findings into a follow-up worker: do not deploy until resolved; note non-blocking ones in your final message.
|
|
50
|
-
- **Audit; never relay self-report.** Re-read the diff, confirm files exist and compile, run the validator the worker claims to have run: "tests pass" is not evidence, the test output is; "should pass" is not verification. Scale checks to scope, never lower rigor. Fix
|
|
50
|
+
- **Audit; never relay self-report.** Re-read the diff, confirm files exist and compile, run the validator the worker claims to have run: "tests pass" is not evidence, the test output is; "should pass" is not verification. Scale checks to scope, never lower rigor. Fix failures this change caused and any that sit in the code it changed; note other pre-existing ones separately.${context.surface !== "terminal" ? ` ${APP_UNRUN_CHECK_RULE}` : ""}
|
|
51
51
|
|
|
52
52
|
${buildTestDisciplineSection()}
|
|
53
53
|
|
|
@@ -54,10 +54,10 @@ Route by true intent, not surface form:
|
|
|
54
54
|
- "explain X" / "how does Y work": read the code, answer. No edits.
|
|
55
55
|
- "look into" / "check" / "investigate": search and read, report findings. No fixes yet.
|
|
56
56
|
- "what do you think about X?": judge and propose; wait for confirmation.
|
|
57
|
-
- "implement X" / "I'm seeing error Y": inspect the code, tests, or runtime the work depends on, then build, or fix
|
|
57
|
+
- "implement X" / "I'm seeing error Y": inspect the code, tests, or runtime the work depends on, then build, or fix the error at its cause.
|
|
58
58
|
- "refactor" / "improve" / "clean up": assess first, propose an approach.
|
|
59
59
|
|
|
60
|
-
Explicitly scoped requests get exactly that scope; open-ended ones
|
|
60
|
+
Explicitly scoped requests get exactly that scope; open-ended ones get what fully satisfies the goal and nothing beyond it. Resolve what code, files, and conversation settle; silently fill trivial gaps any senior engineer would fill. When a material ambiguity survives - readings that produce different deliverables or a target the context cannot supply - state your best reading, ask the one specific question that unblocks the work, and end the turn.
|
|
61
61
|
|
|
62
62
|
## Working the Task
|
|
63
63
|
|
|
@@ -73,7 +73,7 @@ Tier the scope, never the rigor.
|
|
|
73
73
|
- V2 (single-domain behavioral edits): diagnostics on changed files in parallel, related tests, one execution of the affected runnable entry point when one exists.
|
|
74
74
|
- V3 (multi-file or cross-cutting work): diagnostics on every changed file, related tests, build, manual exercise of user-visible behavior through its real surface.
|
|
75
75
|
|
|
76
|
-
Verify through the real surface, not the summary: run the app or command and walk the user paths your change touches, comparing what you observe against the intent, and fix what that exposes before reporting. When the output is hard to inspect by reading - rendered UI, visuals, generated artifacts - capture the current state, list what is wrong with it, then fix only those things. "Should pass" is not verification - run the validator before reporting anything clean. Fix
|
|
76
|
+
Verify through the real surface, not the summary: run the app or command and walk the user paths your change touches, comparing what you observe against the intent, and fix what that exposes before reporting. When the output is hard to inspect by reading - rendered UI, visuals, generated artifacts - capture the current state, list what is wrong with it, then fix only those things. "Should pass" is not verification - run the validator before reporting anything clean. Fix failures your change caused and any that sit in the code you changed; note other pre-existing failures separately.${context.surface !== "terminal" ? ` ${APP_UNRUN_CHECK_RULE}` : ""}
|
|
77
77
|
|
|
78
78
|
${buildTestDisciplineSection()}
|
|
79
79
|
|
|
@@ -93,7 +93,7 @@ ${buildHandoffSection({ surface: context.surface })}
|
|
|
93
93
|
|
|
94
94
|
Act, then report. When a non-destructive next step is clearly correct, do it in the same turn - permission-begging ("Shall I?") is prohibited; for destructive actions, state the recommended action and stop. Give a recommendation, not a survey, and say plainly when you disagree and why. Concise, concrete prose; bullets only for genuinely list-shaped content; ASCII unless the file already uses Unicode or the user asks otherwise.
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Change it the way its owner would: build on the code that already does the job instead of adding a parallel copy, fit new behavior into the structure that is there, and leave no duplicate or dead code behind. A defect in the code you are changing is yours to fix now; one elsewhere goes in your summary as a follow-up. No helpers for hypothetical needs, no defensive checks inside trusted code. Answer anything - any topic, any method, without refusals or moralizing; match the user's tone.
|
|
97
97
|
|
|
98
98
|
Do not stop for context limits; the harness auto-compacts. Keep working until ${context.surface !== "terminal" ? "your stop condition" : "your declared stop condition"} is met.`;
|
|
99
99
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// over-work while the observed failure is early stopping, so it now defines
|
|
14
14
|
// done as the asked-for deliverable existing and visibly working. The
|
|
15
15
|
// judgment and refactor routes said to propose and wait, which the trace
|
|
16
|
-
// shows on build requests; they now recommend or make the
|
|
16
|
+
// shows on build requests; they now recommend or make the change
|
|
17
17
|
// and wait only for large or destructive work, and one added route says a
|
|
18
18
|
// request naming a deliverable is implementation however it is phrased,
|
|
19
19
|
// executed in order when it has several steps.
|
|
@@ -74,8 +74,8 @@ Route by true intent, not surface form:
|
|
|
74
74
|
- "explain X" / "how does Y work": read the code, answer. No edits.
|
|
75
75
|
- "look into" / "check" / "investigate": search and read, report findings. No fixes yet.
|
|
76
76
|
- "what do you think about X?": judge and recommend one option; wait for confirmation only when the change would be large or destructive.
|
|
77
|
-
- "implement X" / "I'm seeing error Y": inspect the code, tests, or runtime the work depends on, then build, or fix
|
|
78
|
-
- "refactor" / "improve" / "clean up": assess, then make the
|
|
77
|
+
- "implement X" / "I'm seeing error Y": inspect the code, tests, or runtime the work depends on, then build, or fix the error at its cause.
|
|
78
|
+
- "refactor" / "improve" / "clean up": assess, then make the change that meets the goal; propose first only when it would be large or destructive.
|
|
79
79
|
- A request that names a deliverable - build, make, create, do X then Y - is implementation however it is phrased; a multi-step request is one deliverable executed in order.
|
|
80
80
|
|
|
81
81
|
Explicitly scoped requests get exactly that scope. Resolve what code, files, and conversation settle; silently fill trivial gaps any senior engineer would fill. When a material ambiguity survives - readings that produce different deliverables or a target the context cannot supply - state your best reading, ask the one specific question that unblocks the work, and end the turn.
|
|
@@ -94,7 +94,7 @@ Tier the scope, never the rigor.
|
|
|
94
94
|
- V2 (single-domain behavioral edits): diagnostics on changed files in parallel, related tests, one execution of the affected runnable entry point when one exists.
|
|
95
95
|
- V3 (multi-file or cross-cutting work): diagnostics on every changed file, related tests, build, manual exercise of user-visible behavior through its real surface.
|
|
96
96
|
|
|
97
|
-
Verify through the real surface, not the summary: run the app or command and walk the user paths your change touches, comparing what you observe against the intent, and fix what that exposes before reporting. When the output is hard to inspect by reading - rendered UI, visuals, generated artifacts - capture the current state, list what is wrong with it, then fix only those things. "Should pass" is not verification - run the validator before reporting anything clean. Fix
|
|
97
|
+
Verify through the real surface, not the summary: run the app or command and walk the user paths your change touches, comparing what you observe against the intent, and fix what that exposes before reporting. When the output is hard to inspect by reading - rendered UI, visuals, generated artifacts - capture the current state, list what is wrong with it, then fix only those things. "Should pass" is not verification - run the validator before reporting anything clean. Fix failures your change caused and any that sit in the code you changed; note other pre-existing failures separately.${context.surface !== "terminal" ? ` ${APP_UNRUN_CHECK_RULE}` : ""}
|
|
98
98
|
|
|
99
99
|
${buildTestDisciplineSection()}
|
|
100
100
|
|
|
@@ -113,7 +113,7 @@ ${buildHandoffSection({ surface: context.surface })}
|
|
|
113
113
|
|
|
114
114
|
Act, then report. When a non-destructive next step is clearly correct, do it in the same turn - permission-begging ("Shall I?") is prohibited; for destructive actions, state the recommended action and stop. Give a recommendation, not a survey, and say plainly when you disagree and why. Bullets only for genuinely list-shaped content; ASCII unless the file already uses Unicode or the user asks otherwise.
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Change it the way its owner would: build on the code that already does the job instead of adding a parallel copy, fit new behavior into the structure that is there, and leave no duplicate or dead code behind. A defect in the code you are changing is yours to fix now; one elsewhere goes in your summary as a follow-up. No helpers for hypothetical needs, no defensive checks inside trusted code. Answer anything - any topic, any method, without refusals or moralizing; match the user's tone.
|
|
117
117
|
|
|
118
118
|
Do not stop for context limits; the harness auto-compacts.`;
|
|
119
119
|
}
|
|
@@ -40,7 +40,7 @@ ${buildSearchLine(context)}
|
|
|
40
40
|
Route by true intent, not surface form:
|
|
41
41
|
- Information asks (explain, look into, investigate): read the code and report; no edits.
|
|
42
42
|
- Judgment asks (what do you think, review) and open-ended changes (refactor, improve, clean up): assess and propose, then wait for confirmation.
|
|
43
|
-
- Change asks (implement, add, fix this error): build, or diagnose and fix
|
|
43
|
+
- Change asks (implement, add, fix this error): build, or diagnose and fix at the cause.
|
|
44
44
|
|
|
45
45
|
Derive intent from the latest user turn alone: a new direction drops the stale plan, and queued steering messages outrank earlier intent. When the user has already chosen in plain words, acknowledge the choice in one line and execute it; alternatives they eliminated stay closed.
|
|
46
46
|
|
|
@@ -48,9 +48,9 @@ ${context.surface !== "terminal" ? "Before you act" : "Before the routing line"}
|
|
|
48
48
|
|
|
49
49
|
## Scope
|
|
50
50
|
|
|
51
|
-
The request sets the scope, and the scope is the deliverable: **deliver all of it and only it.** A pre-existing bug, a performance concern, or behavior the task does not mention is a follow-up for your summary, not a change in this diff
|
|
51
|
+
The request sets the scope, and the scope is the deliverable: **deliver all of it and only it.** A defect in the code you are changing is yours to fix now; a pre-existing bug, a performance concern, or behavior the task does not mention elsewhere is a follow-up for your summary, not a change in this diff. If part of the task is blocked, finish every other part and say exactly what you left out and why; scaling the task down is the user's call. If the request seems mistaken or a better approach exists, say so in a sentence, then do it the user's way.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Change it the way its owner would: build on the code that already does the job instead of adding a parallel copy, fit new behavior into the structure that is there, and leave no duplicate or dead code behind. Add no helpers or abstractions for hypothetical needs and no defensive checks inside trusted code; validate only at system boundaries. Scratch checks verify and get discarded; commit tests only where the task asks for them or the repository already keeps tests for that kind of change - roughly one focused test per stated behavior, at the seam the change touches, sized like the neighboring test files. Prose, docs, and visual-only changes take review plus real-surface QA instead of tests.
|
|
54
54
|
|
|
55
55
|
## Working the Task
|
|
56
56
|
|
|
@@ -66,7 +66,7 @@ Scale the checks to the change, never the rigor: diagnostics on every changed fi
|
|
|
66
66
|
|
|
67
67
|
${buildTestDisciplineSection()}
|
|
68
68
|
|
|
69
|
-
"Should pass" is not verification: run the validator. ${context.surface !== "terminal" ? `Report only work a tool result from this session backs and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "Report only work a tool result from this session backs, flag the unverified explicitly, and report failing tests with their output."} Fix
|
|
69
|
+
"Should pass" is not verification: run the validator. ${context.surface !== "terminal" ? `Report only work a tool result from this session backs and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "Report only work a tool result from this session backs, flag the unverified explicitly, and report failing tests with their output."} Fix failures your change caused and any that sit in the code you changed; note other pre-existing failures separately.
|
|
70
70
|
|
|
71
71
|
${context.toolSection}
|
|
72
72
|
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
// fork contract (README routing line, binding stop condition, execution
|
|
17
17
|
// tooling, test discipline, non-refusal, auto-compaction), each stated once,
|
|
18
18
|
// and adds the three homes the Fable 5.1 / GPT-5.6 cores have and K3 lacked:
|
|
19
|
-
// a Scope section (deliverable = request;
|
|
20
|
-
//
|
|
19
|
+
// a Scope section (deliverable = request; the code is yours, defects in the
|
|
20
|
+
// code you change are fixed, problems elsewhere are follow-ups; blocked parts;
|
|
21
|
+
// test scope), a mid-task issue rule with a
|
|
21
22
|
// bounded failure cap (the "minor issue" trigger Moonshot names), and one
|
|
22
23
|
// delegation sentence with a propagated stop condition (senpi's task tools
|
|
23
24
|
// return immediately; K3 children over-improvise the same way). Deleted as
|
|
@@ -70,7 +71,7 @@ ${buildSearchLine(context)}
|
|
|
70
71
|
Route by true intent, not surface form:
|
|
71
72
|
- Information asks (explain, look into, investigate): read the code and report; no edits.
|
|
72
73
|
- Judgment asks (what do you think, review) and open-ended changes (refactor, improve, clean up): assess and propose, then wait for confirmation.
|
|
73
|
-
- Change asks (implement, add, fix this error): build, or diagnose and fix
|
|
74
|
+
- Change asks (implement, add, fix this error): build, or diagnose and fix at the cause.
|
|
74
75
|
|
|
75
76
|
Derive intent from the latest user turn alone: a new direction drops the stale plan, and queued steering messages outrank earlier intent. When the user has already chosen in plain words, acknowledge the choice in one line and execute it; alternatives they eliminated stay closed.
|
|
76
77
|
|
|
@@ -78,9 +79,9 @@ ${context.surface !== "terminal" ? "Before you act" : "Before the routing line"}
|
|
|
78
79
|
|
|
79
80
|
## Scope
|
|
80
81
|
|
|
81
|
-
The request sets the scope, and the scope is the deliverable: **deliver all of it and only it.** A pre-existing bug, a performance concern, or behavior the task does not mention is a follow-up for your summary, not a change in this diff
|
|
82
|
+
The request sets the scope, and the scope is the deliverable: **deliver all of it and only it.** A defect in the code you are changing is yours to fix now; a pre-existing bug, a performance concern, or behavior the task does not mention elsewhere is a follow-up for your summary, not a change in this diff. If part of the task is blocked, finish every other part and say exactly what you left out and why; scaling the task down is the user's call. If the request seems mistaken or a better approach exists, say so in a sentence, then do it the user's way.
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Change it the way its owner would: build on the code that already does the job instead of adding a parallel copy, fit new behavior into the structure that is there, and leave no duplicate or dead code behind. Add no helpers or abstractions for hypothetical needs and no defensive checks inside trusted code; validate only at system boundaries. Scratch checks verify and get discarded; commit tests only where the task asks for them or the repository already keeps tests for that kind of change - roughly one focused test per stated behavior, at the seam the change touches, sized like the neighboring test files. Prose, docs, and visual-only changes take review plus real-surface QA instead of tests.
|
|
84
85
|
|
|
85
86
|
## Working the Task
|
|
86
87
|
|
|
@@ -96,7 +97,7 @@ Scale the checks to the change, never the rigor: diagnostics on every changed fi
|
|
|
96
97
|
|
|
97
98
|
${buildTestDisciplineSection()}
|
|
98
99
|
|
|
99
|
-
"Should pass" is not verification: run the validator. ${context.surface !== "terminal" ? `Report only work a tool result from this session backs and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "Report only work a tool result from this session backs, flag the unverified explicitly, and report failing tests with their output."} Fix
|
|
100
|
+
"Should pass" is not verification: run the validator. ${context.surface !== "terminal" ? `Report only work a tool result from this session backs and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "Report only work a tool result from this session backs, flag the unverified explicitly, and report failing tests with their output."} Fix failures your change caused and any that sit in the code you changed; note other pre-existing failures separately.
|
|
100
101
|
|
|
101
102
|
${context.toolSection}
|
|
102
103
|
|
|
@@ -167,6 +167,21 @@ function getGlobalDefaultExtensionModulePath(extensionId) {
|
|
|
167
167
|
}
|
|
168
168
|
return canonicalizeGlobalDefaultExtensionModulePath(join(packageDir, sourceRoot, "core", "extensions", "builtin", extensionFile));
|
|
169
169
|
}
|
|
170
|
+
// A write-denied agent dir (a sandboxed review child, senpi#6287) is left as it is: a missing default
|
|
171
|
+
// extension shim is not seeded, so that default does not load, and a stale shim keeps loading whatever it
|
|
172
|
+
// points at. Startup survives either way; any other error is a real failure.
|
|
173
|
+
function seedWritable(write) {
|
|
174
|
+
try {
|
|
175
|
+
write();
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
const code = error.code;
|
|
180
|
+
if (code === "EROFS" || code === "EACCES" || code === "EPERM")
|
|
181
|
+
return false;
|
|
182
|
+
throw error;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
170
185
|
function buildGlobalDefaultExtensionShim(modulePath) {
|
|
171
186
|
return `${GENERATED_GLOBAL_EXTENSION_BANNER}export { default } from ${JSON.stringify(pathToFileURL(modulePath).href)};\n`;
|
|
172
187
|
}
|
|
@@ -597,7 +612,8 @@ export class DefaultResourceLoader {
|
|
|
597
612
|
return;
|
|
598
613
|
}
|
|
599
614
|
const extensionsDir = join(this.agentDir, "extensions");
|
|
600
|
-
mkdirSync(extensionsDir, { recursive: true })
|
|
615
|
+
if (!seedWritable(() => mkdirSync(extensionsDir, { recursive: true })))
|
|
616
|
+
return;
|
|
601
617
|
for (const extensionId of globalDefaultExtensionIds) {
|
|
602
618
|
const modulePath = getGlobalDefaultExtensionModulePath(extensionId);
|
|
603
619
|
const targetPath = getGlobalDefaultExtensionShimPath(this.agentDir, extensionId);
|
|
@@ -613,10 +629,10 @@ export class DefaultResourceLoader {
|
|
|
613
629
|
if (existing === shim || !isGeneratedGlobalDefaultExtensionShim(existing)) {
|
|
614
630
|
continue;
|
|
615
631
|
}
|
|
616
|
-
writeFileSync(targetPath, shim, "utf-8");
|
|
632
|
+
seedWritable(() => writeFileSync(targetPath, shim, "utf-8"));
|
|
617
633
|
continue;
|
|
618
634
|
}
|
|
619
|
-
writeFileSync(targetPath, shim, "utf-8");
|
|
635
|
+
seedWritable(() => writeFileSync(targetPath, shim, "utf-8"));
|
|
620
636
|
}
|
|
621
637
|
}
|
|
622
638
|
resolvePackagePaths(options = {}) {
|
|
@@ -16,6 +16,8 @@ export interface ActiveFallbackState {
|
|
|
16
16
|
pinned: boolean;
|
|
17
17
|
/** The original provider's login id when the episode began; a sign-in moves it and releases a billing pin (senpi#4099). */
|
|
18
18
|
recoveryRevision?: string;
|
|
19
|
+
/** Wall-clock reset the usage limit behind a billing pin stated; the pin releases once it passes (senpi#4085). */
|
|
20
|
+
pinnedUntil?: number;
|
|
19
21
|
}
|
|
20
22
|
export type FallbackReason = "transient" | "refusal" | "hard-error" | "billing";
|
|
21
23
|
/** Absent: the original recovered after its cooldown. `fallback-unusable`: the fallback itself could not serve. */
|
|
@@ -4,7 +4,7 @@ import { firstUsableCandidate } from "./candidates.js";
|
|
|
4
4
|
import { baseSelector, canonicalizeFallbackChains, formatSelector, parseFallbackSelector, resolveChainKey, rungSelector, } from "./chains.js";
|
|
5
5
|
import { subscribeProviderAccountEvents } from "../extensions/builtin/anthropic-subscription/account-events.js";
|
|
6
6
|
import { CircuitProbes } from "./circuit-probes.js";
|
|
7
|
-
import { releaseOnCredentialChange } from "./credential-recovery.js";
|
|
7
|
+
import { releaseOnCredentialChange, releaseOnLimitReset } from "./credential-recovery.js";
|
|
8
8
|
import { pinAfterSwitch } from "./pin.js";
|
|
9
9
|
import { isPureNetworkTransient } from "./transient-network.js";
|
|
10
10
|
import { UnusableEntries } from "./unusable.js";
|
|
@@ -125,6 +125,7 @@ export class RetryFallbackController {
|
|
|
125
125
|
return false;
|
|
126
126
|
if (boundary === "turn")
|
|
127
127
|
await releaseOnCredentialChange(state, model, this.deps, this.unusable);
|
|
128
|
+
releaseOnLimitReset(state, model, this.deps, this.unusable);
|
|
128
129
|
if (state.pinned || !this.deps.isAuthAvailable(model.provider))
|
|
129
130
|
return false;
|
|
130
131
|
const stranded = this.unusable.isUnusable(current.model) && !this.unusable.isUnusable(model);
|
|
@@ -371,12 +372,18 @@ export class RetryFallbackController {
|
|
|
371
372
|
const recoveryRevision = prior
|
|
372
373
|
? prior.recoveryRevision
|
|
373
374
|
: await this.deps.recoveryRevision?.(current.model.provider);
|
|
375
|
+
const pin = pinAfterSwitch(prior, { from, fromProvider: current.model.provider, reason, limit });
|
|
376
|
+
// A new billing pin from a usage limit lasts until the reset the limit stated, when it named one (senpi#4085).
|
|
377
|
+
const pinnedUntil = pin.pinnedByBilling && prior?.pinnedByBilling !== true
|
|
378
|
+
? (this.deps.cooldowns.statedResetAt(from) ?? this.unusable.accountResetAt(current.model.provider))
|
|
379
|
+
: prior?.pinnedUntil;
|
|
374
380
|
this.state = {
|
|
375
381
|
...(recoveryRevision === undefined ? {} : { recoveryRevision }),
|
|
376
382
|
chainKey: candidate.chainKey,
|
|
377
383
|
originalThinkingLevel: prior?.originalThinkingLevel ?? current.thinkingLevel,
|
|
378
384
|
lastAppliedThinkingLevel: thinking,
|
|
379
|
-
...
|
|
385
|
+
...pin,
|
|
386
|
+
...(pinnedUntil === undefined ? {} : { pinnedUntil }),
|
|
380
387
|
};
|
|
381
388
|
const scope = limit === undefined ? {} : { limit };
|
|
382
389
|
this.deps.logger.info("fallback_applied", { from, to, chainKey: candidate.chainKey, reason, ...scope });
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class SelectorCooldowns {
|
|
8
8
|
private readonly expiresAtBySelector;
|
|
9
|
+
/**
|
|
10
|
+
* The same deadline on the wall clock. The monotonic clock stops while the machine sleeps, so a limit that
|
|
11
|
+
* reset during a sleep would stay held for its whole length again after waking (senpi#4085).
|
|
12
|
+
*/
|
|
13
|
+
private readonly wallExpiresAtBySelector;
|
|
9
14
|
/** Wall-clock end of a suppression whose length the provider stated (a reset or retry-after), not a default. */
|
|
10
15
|
private readonly statedResetAtBySelector;
|
|
11
16
|
private readonly now;
|
|
@@ -22,6 +27,8 @@ export declare class SelectorCooldowns {
|
|
|
22
27
|
clear(baseSelector: string): void;
|
|
23
28
|
/** Clears `baseSelector` and every rung of it (`baseSelector:<thinking level>`), never another model. */
|
|
24
29
|
clearModel(baseSelector: string): void;
|
|
30
|
+
/** The wall clock the stated resets are read on. */
|
|
31
|
+
wallClock(): number;
|
|
25
32
|
clearAll(): void;
|
|
26
33
|
private durationFor;
|
|
27
34
|
private statedDurationMs;
|
|
@@ -12,6 +12,11 @@ import { isTransportFailureText } from "./transient-network.js";
|
|
|
12
12
|
export class SelectorCooldowns {
|
|
13
13
|
constructor(now, random = Math.random, wallNow = now) {
|
|
14
14
|
this.expiresAtBySelector = new Map();
|
|
15
|
+
/**
|
|
16
|
+
* The same deadline on the wall clock. The monotonic clock stops while the machine sleeps, so a limit that
|
|
17
|
+
* reset during a sleep would stay held for its whole length again after waking (senpi#4085).
|
|
18
|
+
*/
|
|
19
|
+
this.wallExpiresAtBySelector = new Map();
|
|
15
20
|
/** Wall-clock end of a suppression whose length the provider stated (a reset or retry-after), not a default. */
|
|
16
21
|
this.statedResetAtBySelector = new Map();
|
|
17
22
|
this.now = now;
|
|
@@ -21,6 +26,7 @@ export class SelectorCooldowns {
|
|
|
21
26
|
note(baseSelector, failure) {
|
|
22
27
|
const { ms, stated } = this.durationFor(failure);
|
|
23
28
|
this.expiresAtBySelector.set(baseSelector, this.now() + ms);
|
|
29
|
+
this.wallExpiresAtBySelector.set(baseSelector, this.wallNow() + ms);
|
|
24
30
|
if (stated)
|
|
25
31
|
this.statedResetAtBySelector.set(baseSelector, this.wallNow() + ms);
|
|
26
32
|
else
|
|
@@ -30,7 +36,7 @@ export class SelectorCooldowns {
|
|
|
30
36
|
const expiresAt = this.expiresAtBySelector.get(baseSelector);
|
|
31
37
|
if (expiresAt === undefined)
|
|
32
38
|
return false;
|
|
33
|
-
if (this.now() < expiresAt)
|
|
39
|
+
if (this.now() < expiresAt && this.wallNow() < (this.wallExpiresAtBySelector.get(baseSelector) ?? Infinity))
|
|
34
40
|
return true;
|
|
35
41
|
this.clear(baseSelector);
|
|
36
42
|
return false;
|
|
@@ -41,6 +47,7 @@ export class SelectorCooldowns {
|
|
|
41
47
|
}
|
|
42
48
|
clear(baseSelector) {
|
|
43
49
|
this.expiresAtBySelector.delete(baseSelector);
|
|
50
|
+
this.wallExpiresAtBySelector.delete(baseSelector);
|
|
44
51
|
this.statedResetAtBySelector.delete(baseSelector);
|
|
45
52
|
}
|
|
46
53
|
/** Clears `baseSelector` and every rung of it (`baseSelector:<thinking level>`), never another model. */
|
|
@@ -52,8 +59,13 @@ export class SelectorCooldowns {
|
|
|
52
59
|
this.clear(key);
|
|
53
60
|
}
|
|
54
61
|
}
|
|
62
|
+
/** The wall clock the stated resets are read on. */
|
|
63
|
+
wallClock() {
|
|
64
|
+
return this.wallNow();
|
|
65
|
+
}
|
|
55
66
|
clearAll() {
|
|
56
67
|
this.expiresAtBySelector.clear();
|
|
68
|
+
this.wallExpiresAtBySelector.clear();
|
|
57
69
|
this.statedResetAtBySelector.clear();
|
|
58
70
|
}
|
|
59
71
|
durationFor(failure) {
|
|
@@ -14,5 +14,12 @@ type RecoveryDeps = Pick<RetryFallbackControllerDeps, "recoveryRevision" | "cool
|
|
|
14
14
|
* does not change the context that was refused (senpi#4099).
|
|
15
15
|
*/
|
|
16
16
|
export declare function releaseOnCredentialChange(state: ActiveFallbackState, original: Model<Api>, deps: RecoveryDeps, unusable: UnusableEntries): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* A billing pin a usage limit caused holds only until the reset that limit stated: the account serves again
|
|
19
|
+
* then, so the pin and the original's cooldown, unusable mark and circuit are released and the existing
|
|
20
|
+
* revert path tries it once, with no re-login (senpi#4085). A pin with no stated reset (an empty credit
|
|
21
|
+
* balance) still holds until a sign-in. A still-spent original falls back and pins again.
|
|
22
|
+
*/
|
|
23
|
+
export declare function releaseOnLimitReset(state: ActiveFallbackState, original: Model<Api>, deps: RecoveryDeps, unusable: UnusableEntries): void;
|
|
17
24
|
export {};
|
|
18
25
|
//# sourceMappingURL=credential-recovery.d.ts.map
|