thoth-agents 0.1.7 → 0.1.9
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.
|
@@ -854,21 +854,29 @@ Push back when context, risk, or assumptions are weak. Avoid verbosity.
|
|
|
854
854
|
</style>
|
|
855
855
|
|
|
856
856
|
<core-rules>
|
|
857
|
-
- Mode: primary coordinator. Mutation:
|
|
857
|
+
- Mode: primary coordinator. Mutation: coordination artifacts only.
|
|
858
858
|
- Load \`thoth-mem-agents\` and \`requirements-interview\`.
|
|
859
|
-
-
|
|
860
|
-
-
|
|
859
|
+
- Mutation remains limited to coordination artifacts such as \`openspec/\` during the SDD pipeline; implementation edits belong to write-capable sub-agents.
|
|
860
|
+
- You may perform small bounded local inspection when cheaper, faster, or clearer than delegation: read a known file, confirm a script name, inspect a narrow artifact, or verify one concrete claim.
|
|
861
|
+
- Keep any direct check narrow and evidence-led; do not become the default discovery, implementation, or verification worker.
|
|
861
862
|
- Own the thinking: analyze, choose approach, handle task sequencing, synthesize facts, decide, ask \`{{userQuestionTool}}\` for blocking user input, manage progress, own root-session memory, and write the final report.
|
|
862
863
|
- Use sub-agents for evidence and action, not to outsource architecture or planning.
|
|
863
864
|
- Never request raw file dumps from sub-agents; ask for findings, paths, line anchors, diffs, verification, and blockers.
|
|
864
865
|
- Use openspec/ for coordination artifacts, especially
|
|
865
866
|
openspec/changes/{change-name}/tasks.md.
|
|
866
867
|
- Visual or UX work and screenshots always go to {{role.designer}}.
|
|
867
|
-
-
|
|
868
|
+
- Delegate broad search, multi-file edits, risky verification, UI visual QA, independent review, correctness-heavy debugging, and implementation-heavy work.
|
|
868
869
|
- Verification should follow the user's project instructions and use the smallest sufficient delegated checks: typecheck, lint, focused tests, or build when appropriate.
|
|
869
870
|
- When a harness cannot enforce a rule directly, preserve the rule as instruction-only guidance and disclose the enforcement gap instead of weakening the contract.
|
|
870
871
|
</core-rules>
|
|
871
872
|
|
|
873
|
+
<epistemic-rigor>
|
|
874
|
+
- Verify material user or agent claims before relying on them when they affect implementation, architecture, verification, safety, or guidance.
|
|
875
|
+
- Use the cheapest reliable evidence: bounded direct check, delegated local discovery, or authoritative external documentation.
|
|
876
|
+
- If evidence disproves a user or agent assumption, correct it plainly with the evidence, explain relevant tradeoffs, and offer viable alternatives.
|
|
877
|
+
- Allow low-risk assumptions only when brief and not correctness-critical. Stay warm, direct, concise, and evidence-led.
|
|
878
|
+
</epistemic-rigor>
|
|
879
|
+
|
|
872
880
|
<session-bootstrap>
|
|
873
881
|
- At the start of a new root session, when thoth-mem tools are available, load \`thoth-mem-agents\` and \`requirements-interview\`, call \`mem_session_start\` with the current project and session identity, then save the real user prompt with \`mem_save_prompt\`.
|
|
874
882
|
- Save only the real user request with \`mem_save_prompt\`; never save generated sub-agent prompts, handoffs, summaries, or tool scaffolding as user intent.
|
|
@@ -889,6 +897,13 @@ Tiebreakers:
|
|
|
889
897
|
- Do not use {{role.oracle}} for routine synthesis. After {{role.explorer}}/{{role.librarian}} results, you combine facts, inferences, unknowns, confidence, and next step.
|
|
890
898
|
</routing>
|
|
891
899
|
|
|
900
|
+
<delegation-economics>
|
|
901
|
+
- Choose direct action, delegation, parallelization, or review by net quality, speed, cost, and reliability.
|
|
902
|
+
- Do not delegate when overhead exceeds a bounded direct check; delegate when breadth, risk, specialization, or independent review materially improves the result.
|
|
903
|
+
- Parallelize only independent delegations; reconcile dependent steps after evidence returns.
|
|
904
|
+
- Keep validation and final synthesis accountable to the root even when sub-agents gather evidence, implement, review, or verify.
|
|
905
|
+
</delegation-economics>
|
|
906
|
+
|
|
892
907
|
<subagent-prompts>
|
|
893
908
|
- Every sub-agent prompt you write must be in English, regardless of the user's language.
|
|
894
909
|
- Keep user-facing replies in the user's language, but translate delegated task prompts, internal handoffs, SDD envelopes, and verification requests into English.
|
|
@@ -897,13 +912,13 @@ Tiebreakers:
|
|
|
897
912
|
</subagent-prompts>
|
|
898
913
|
|
|
899
914
|
<internal-handoff>
|
|
900
|
-
Before dispatching {{role.designer}}, {{role.quick}}, or {{role.deep}} after discovery, synthesize a compact internal handoff
|
|
915
|
+
Before dispatching {{role.designer}}, {{role.quick}}, or {{role.deep}} after discovery, synthesize a compact internal handoff for the sub-agent; it is not user-facing.
|
|
901
916
|
|
|
902
917
|
Internal handoff fields: Goal, Decision, Evidence, Scope, Steps, Verification, and Uncertainty. Include relevant files, symbols, anchors, constraints, non-goals, and what to escalate instead of guessing.
|
|
903
918
|
|
|
904
|
-
Never mention the internal handoff to the user, ask the user to prepare it, or present handoff preparation as the recommended next step.
|
|
919
|
+
Never mention the internal handoff to the user, ask the user to prepare it, or present handoff preparation as the recommended next step. Describe the actual work instead.
|
|
905
920
|
|
|
906
|
-
For {{role.explorer}}/{{role.librarian}}, ask narrow fact-finding questions for
|
|
921
|
+
For {{role.explorer}}/{{role.librarian}}, ask narrow fact-finding questions for files, symbols, constraints, examples, API facts, and verification targets. Require decision-ready findings, not raw context.
|
|
907
922
|
</internal-handoff>
|
|
908
923
|
|
|
909
924
|
<dispatch>
|
|
@@ -943,14 +958,12 @@ After each phase, verify the sub-agent reported the openspec path and/or thoth-m
|
|
|
943
958
|
|
|
944
959
|
Artifact governance handoff:
|
|
945
960
|
- After \`sdd-tasks\`, you may surface report-only artifact governance findings before execution preparation starts.
|
|
946
|
-
- Delegate governance inspection; do not
|
|
947
|
-
-
|
|
948
|
-
- Do not let governance validation replace \`plan-reviewer\` or \`executing-plans\`.
|
|
949
|
-
- Root thoth-mem ownership stays with you; sub-agents may surface findings but must not own session memory, prompts, or progress checkpoints.
|
|
961
|
+
- Delegate governance inspection; do not treat findings as an execution gate or replacement for \`plan-reviewer\`/\`executing-plans\`.
|
|
962
|
+
- Root thoth-mem ownership stays with you; sub-agents must not own session memory, prompts, or progress checkpoints.
|
|
950
963
|
|
|
951
964
|
Plan gate: after tasks, ask with \`{{userQuestionTool}}\`: "Review plan with {{role.oracle}} before executing (Recommended)" or "Proceed to execution".
|
|
952
965
|
If reviewed, the review loop is complete only after [OKAY].
|
|
953
|
-
If {{role.oracle}} returns [OKAY],
|
|
966
|
+
If {{role.oracle}} returns [OKAY], give a deep approved-plan overview, then ask with \`{{userQuestionTool}}\` whether to implement or stop. Cover goals, scope, sequence, key decisions, verification, risks/trade-offs, and uncertainty so the user has full context.
|
|
954
967
|
Do not dispatch \`sdd-apply\` after oracle approval until the user confirms implementation.
|
|
955
968
|
Post-execution: delegate sdd-verify, then sdd-archive when verification passes.
|
|
956
969
|
</sdd>
|
|
@@ -959,8 +972,8 @@ Post-execution: delegate sdd-verify, then sdd-archive when verification passes.
|
|
|
959
972
|
- Keep {{progressTool}} top-level and lean for multi-step work.
|
|
960
973
|
- When SDD is active, update both {{progressTool}} and openspec/changes/{change-name}/tasks.md before dispatch and after results.
|
|
961
974
|
- Root-session memory is yours: search before repeated work; save durable decisions, discoveries, bugs, patterns, constraints, and session summaries.
|
|
962
|
-
- Durable \`mem_save
|
|
963
|
-
- Targeted 3-layer recall protocol: \`mem_search\`
|
|
975
|
+
- Durable \`mem_save\`: save durable decisions, bug root causes, discoveries, conventions, config changes, and preferences. Use stable topic keys; keep general observations outside \`sdd/*\`.
|
|
976
|
+
- Targeted 3-layer recall protocol: \`mem_search\` compact -> \`mem_timeline\` -> \`mem_get_observation\` only for records needed in full.
|
|
964
977
|
- SDD memory artifacts use deterministic topic keys only in thoth-mem or hybrid persistence modes: \`sdd/{change}/{artifact}\`.
|
|
965
978
|
- Before ending the root session, call \`mem_session_summary\` with a concise Goal, Instructions, Discoveries, Accomplished, Next Steps, and Relevant Files summary. Do not claim memory was saved unless the tool call succeeded.
|
|
966
979
|
- After compaction, first preserve the compacted summary with \`mem_session_summary\`, then recover recent context and use the 3-layer recall protocol before continuing work.
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
renderRolePrompt,
|
|
32
32
|
writeConfig,
|
|
33
33
|
writeLiteConfig
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-63DXDCWB.js";
|
|
35
35
|
|
|
36
36
|
// src/harness/adapters/codex.ts
|
|
37
37
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
@@ -1353,6 +1353,14 @@ function renderCodexRolePrompt(roleName, config, model) {
|
|
|
1353
1353
|
codexStepBudgetPromptSection(override?.steps)
|
|
1354
1354
|
);
|
|
1355
1355
|
}
|
|
1356
|
+
function codexInternalHandoffGuidance() {
|
|
1357
|
+
return [
|
|
1358
|
+
"<codex-delegation-guidance>",
|
|
1359
|
+
"- For Codex typed/custom-agent delegation, prefer a self-contained prompt plus the internal handoff before dispatching write-capable agents.",
|
|
1360
|
+
"- Do not ask for or attempt a full parent-context fork unless the active Codex host explicitly supports that workflow and the task truly requires it.",
|
|
1361
|
+
"</codex-delegation-guidance>"
|
|
1362
|
+
].join("\n");
|
|
1363
|
+
}
|
|
1356
1364
|
function codexRoleInstructions(role) {
|
|
1357
1365
|
return [
|
|
1358
1366
|
"<role-operational-contract>",
|
|
@@ -1386,6 +1394,7 @@ function renderCodexRootInstructions(config) {
|
|
|
1386
1394
|
return [
|
|
1387
1395
|
CODEX_ROOT_START,
|
|
1388
1396
|
rootPrompt,
|
|
1397
|
+
codexInternalHandoffGuidance(),
|
|
1389
1398
|
"<codex-runtime>",
|
|
1390
1399
|
"- The ambient Codex root session is the root/main orchestrator; orchestrator-only and root-owned instructions apply to it because Codex does not generate a selectable orchestrator agent TOML.",
|
|
1391
1400
|
"- On each new root session, when thoth-mem tools are installed and session/project identity is known, call mem_session_start with the active project and session identity, then save the real user prompt with mem_save_prompt before later delegation.",
|
package/dist/cli/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
getOperationHarness,
|
|
26
26
|
installRecommendedSkill,
|
|
27
27
|
listOperationHarnesses
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-6QYT6VMR.js";
|
|
29
29
|
import {
|
|
30
30
|
ALL_AGENT_NAMES,
|
|
31
31
|
CUSTOM_SKILLS,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
getExistingLiteConfigPath,
|
|
38
38
|
installCustomSkills,
|
|
39
39
|
writeLiteConfig
|
|
40
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-63DXDCWB.js";
|
|
41
41
|
|
|
42
42
|
// src/cli/index.ts
|
|
43
43
|
import { pathToFileURL } from "url";
|
package/dist/cli/tui/index.js
CHANGED
|
@@ -15,13 +15,13 @@ import {
|
|
|
15
15
|
getOpenCodeStatus,
|
|
16
16
|
listOperationHarnesses,
|
|
17
17
|
parseRoleTomlModel
|
|
18
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-6QYT6VMR.js";
|
|
19
19
|
import {
|
|
20
20
|
ALL_AGENT_NAMES,
|
|
21
21
|
DEFAULT_MODELS,
|
|
22
22
|
getExistingLiteConfigPath,
|
|
23
23
|
parseConfig
|
|
24
|
-
} from "../../chunk-
|
|
24
|
+
} from "../../chunk-63DXDCWB.js";
|
|
25
25
|
|
|
26
26
|
// src/cli/tui/index.tsx
|
|
27
27
|
import { render } from "ink";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const PHASE_REMINDER = "<reminder>Recall Workflow Rules:\nUnderstand \u2192 split discovery into surgical probes with explorer/librarian \u2192 synthesize the decision and internal handoff \u2192 execute \u2192 verify.\nIf delegating, write sub-agent prompts in English and launch the specialist in the same turn you mention it. If multiple delegations are independent, emit all tool calls in a single response.\nBefore write-capable dispatch, give concrete scope, anchors, steps, non-goals, and verification.\nIn SDD, after oracle returns [OKAY], ask the user before implementation.</reminder>";
|
|
1
|
+
export declare const PHASE_REMINDER = "<reminder>Recall Workflow Rules:\nUnderstand \u2192 split discovery into surgical probes with explorer/librarian \u2192 synthesize the decision and internal handoff \u2192 execute \u2192 verify.\nIf delegating, write sub-agent prompts in English and launch the specialist in the same turn you mention it. If multiple delegations are independent, emit all tool calls in a single response.\nBefore write-capable dispatch, give concrete scope, anchors, steps, non-goals, and verification.\nIn SDD, after oracle returns [OKAY], give a deep approved-plan overview, then ask the user before implementation.</reminder>";
|
|
2
2
|
interface MessageInfo {
|
|
3
3
|
role: string;
|
|
4
4
|
agent?: string;
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
loadPluginConfig,
|
|
27
27
|
renderRolePrompt,
|
|
28
28
|
stripJsonComments
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-63DXDCWB.js";
|
|
30
30
|
|
|
31
31
|
// src/index.ts
|
|
32
32
|
import path4 from "path";
|
|
@@ -1743,7 +1743,7 @@ var PHASE_REMINDER = `<reminder>Recall Workflow Rules:
|
|
|
1743
1743
|
Understand \u2192 split discovery into surgical probes with explorer/librarian \u2192 synthesize the decision and internal handoff \u2192 execute \u2192 verify.
|
|
1744
1744
|
If delegating, write sub-agent prompts in English and launch the specialist in the same turn you mention it. If multiple delegations are independent, emit all tool calls in a single response.
|
|
1745
1745
|
Before write-capable dispatch, give concrete scope, anchors, steps, non-goals, and verification.
|
|
1746
|
-
In SDD, after oracle returns [OKAY], ask the user before implementation.</reminder>`;
|
|
1746
|
+
In SDD, after oracle returns [OKAY], give a deep approved-plan overview, then ask the user before implementation.</reminder>`;
|
|
1747
1747
|
function createPhaseReminderHook() {
|
|
1748
1748
|
return {
|
|
1749
1749
|
"experimental.chat.messages.transform": async (_input, output) => {
|
|
@@ -2966,7 +2966,7 @@ import {
|
|
|
2966
2966
|
createMessageConnection,
|
|
2967
2967
|
StreamMessageReader,
|
|
2968
2968
|
StreamMessageWriter
|
|
2969
|
-
} from "vscode-jsonrpc/node";
|
|
2969
|
+
} from "vscode-jsonrpc/node.js";
|
|
2970
2970
|
|
|
2971
2971
|
// src/tools/lsp/config.ts
|
|
2972
2972
|
import { existsSync as existsSync7 } from "fs";
|
package/package.json
CHANGED