thoth-agents 0.6.0 → 0.8.0

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.
Files changed (85) hide show
  1. package/README.md +7 -1
  2. package/dist/agents/prompt-dialects.d.ts +3 -1
  3. package/dist/{chunk-OW6I7ZUU.js → chunk-4DZSWTUM.js} +337 -155
  4. package/dist/{chunk-7YCSKK2X.js → chunk-5LW4CNA5.js} +4053 -2989
  5. package/dist/{chunk-U7FNFTM5.js → chunk-P7R4GDSO.js} +39 -38
  6. package/dist/{chunk-MRFCA3U2.js → chunk-ZLEMG37R.js} +2 -1
  7. package/dist/cli/codex-config-io.d.ts +34 -2
  8. package/dist/cli/codex-hook-consent.d.ts +5 -0
  9. package/dist/cli/codex-hook-trust.d.ts +23 -0
  10. package/dist/cli/codex-install.d.ts +21 -6
  11. package/dist/cli/codex-lifecycle.d.ts +13 -0
  12. package/dist/cli/codex-plugin-install.d.ts +21 -0
  13. package/dist/cli/index.js +538 -43
  14. package/dist/cli/managed-state-io.d.ts +19 -0
  15. package/dist/cli/operations/codex.d.ts +2 -0
  16. package/dist/cli/operations/types.d.ts +1 -1
  17. package/dist/cli/pi-install.d.ts +1 -0
  18. package/dist/cli/safe-atomic-write.d.ts +2 -0
  19. package/dist/cli/tui/index.js +56 -5
  20. package/dist/cli/tui/operations.d.ts +3 -1
  21. package/dist/cli/types.d.ts +4 -1
  22. package/dist/config/constants.d.ts +30 -3
  23. package/dist/config/schema.d.ts +4 -0
  24. package/dist/harness/adapters/claude-code.d.ts +1 -1
  25. package/dist/harness/adapters/codex-legacy-agents.d.ts +31 -0
  26. package/dist/harness/adapters/codex-surfaces.d.ts +1 -1
  27. package/dist/harness/adapters/codex.d.ts +3 -1
  28. package/dist/harness/codex-hook-script.d.ts +2 -0
  29. package/dist/harness/core/agent-pack.d.ts +8 -2
  30. package/dist/harness/core/result-contract.d.ts +366 -0
  31. package/dist/harness/core/sdd.d.ts +1 -1
  32. package/dist/harness/writers/codex-plugin-package.d.ts +7 -0
  33. package/dist/harness/writers/pi-agent.d.ts +1 -0
  34. package/dist/index.js +2 -2
  35. package/dist/pi.js +2 -2
  36. package/package.json +5 -3
  37. package/pi/.thoth-agents-assets.json +5 -5
  38. package/pi/agents/thoth-designer.md +15 -20
  39. package/pi/agents/thoth-explorer.md +15 -19
  40. package/pi/agents/thoth-librarian.md +15 -19
  41. package/pi/agents/thoth-oracle.md +30 -22
  42. package/pi/agents/thoth-worker.md +13 -18
  43. package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +6 -6
  44. package/plugin/.claude-plugin/plugin.json +1 -1
  45. package/plugin/.codex-plugin/.thoth-agents-plugin-assets.json +48 -0
  46. package/plugin/.codex-plugin/plugin.json +3 -2
  47. package/plugin/agents/designer.md +9 -14
  48. package/plugin/agents/explorer.md +10 -14
  49. package/plugin/agents/librarian.md +9 -13
  50. package/plugin/agents/oracle.md +24 -18
  51. package/plugin/agents/orchestrator.md +38 -61
  52. package/plugin/agents/worker.md +9 -14
  53. package/plugin/codex-hooks/context.cjs +22 -0
  54. package/plugin/codex-hooks/hooks.json +32 -0
  55. package/plugin/codex-hooks/payloads/designer.md +72 -0
  56. package/plugin/codex-hooks/payloads/explorer.md +76 -0
  57. package/plugin/codex-hooks/payloads/librarian.md +76 -0
  58. package/plugin/codex-hooks/payloads/oracle.md +83 -0
  59. package/plugin/codex-hooks/payloads/root.md +105 -0
  60. package/plugin/codex-hooks/payloads/worker.md +72 -0
  61. package/plugin/skills/plan-reviewer/SKILL.md +16 -8
  62. package/plugin/skills/thoth-archive/SKILL.md +2 -1
  63. package/plugin/skills/thoth-constitution/SKILL.md +1 -1
  64. package/plugin/skills/thoth-constitution/templates/constitution.md +1 -1
  65. package/plugin/skills/thoth-init/SKILL.md +1 -1
  66. package/plugin/skills/thoth-sdd/SKILL.md +67 -2
  67. package/plugin/skills/thoth-sdd/references/phases/verify.md +11 -1
  68. package/plugin/skills/thoth-sdd/scripts/result-contract.json +210 -0
  69. package/plugin/skills/thoth-sdd/scripts/validate-result.d.mts +47 -0
  70. package/plugin/skills/thoth-sdd/scripts/validate-result.mjs +390 -0
  71. package/plugin/skills/thoth-sdd/scripts/validate.mjs +213 -8
  72. package/plugin/skills/thoth-sdd/templates/change.md +8 -0
  73. package/skills/plan-reviewer/SKILL.md +16 -8
  74. package/skills/thoth-archive/SKILL.md +2 -1
  75. package/skills/thoth-constitution/SKILL.md +1 -1
  76. package/skills/thoth-constitution/templates/constitution.md +1 -1
  77. package/skills/thoth-init/SKILL.md +1 -1
  78. package/skills/thoth-sdd/SKILL.md +67 -2
  79. package/skills/thoth-sdd/references/phases/verify.md +11 -1
  80. package/skills/thoth-sdd/scripts/result-contract.json +210 -0
  81. package/skills/thoth-sdd/scripts/validate-result.d.mts +47 -0
  82. package/skills/thoth-sdd/scripts/validate-result.mjs +390 -0
  83. package/skills/thoth-sdd/scripts/validate.mjs +213 -8
  84. package/skills/thoth-sdd/templates/change.md +8 -0
  85. package/thoth-agents.schema.json +14 -0
@@ -2,6 +2,8 @@
2
2
  * Harness-agnostic helpers shared by the Codex and Claude Code installers for
3
3
  * managed file writes and managed-model-state JSON bookkeeping.
4
4
  */
5
+ /** Fail closed: backups may replace regular files, never links or special files. */
6
+ export declare function assertSafeBackupDestination(path: string): void;
5
7
  export declare function writeTextWithBackup(path: string, content: string): boolean;
6
8
  export declare function stableJson(value: unknown): string;
7
9
  export declare function uniqueMessages(messages: string[]): string[];
@@ -11,7 +13,24 @@ export interface ManagedModelState {
11
13
  models: Record<string, string>;
12
14
  configuredModels?: Record<string, string>;
13
15
  configuredEfforts?: Record<string, string>;
16
+ /** SHA-256 of the exact last-written Codex TOML bytes, keyed by basename. */
17
+ roleDigests?: Record<string, string>;
18
+ /** SHA-256 excluding model/effort lines, permitting operator model selection. */
19
+ roleStructureDigests?: Record<string, string>;
20
+ /** Original raw capacity integer; null records that the key was absent. */
21
+ priorThreadsValue?: string | null;
22
+ ownedHookTrustKeys?: string[];
14
23
  }
24
+ /** Released pre-digest state: only the original version/models fields. */
25
+ export declare function isLegacyManagedModelState(value: unknown, version: number): boolean;
15
26
  export declare function emptyManagedModelState(version: number): ManagedModelState;
16
27
  export declare function parseManagedModelStateJson(text: string | undefined, version: number): ManagedModelState;
28
+ /** Compare normalized state, allowing only planner-approved role digest refreshes. */
29
+ export declare function managedModelStatesEqual(actual: string, expected: string, version: number, refreshedRoleKeys?: string[]): boolean;
17
30
  export declare function readManagedModelState(path: string, version: number): ManagedModelState;
31
+ /**
32
+ * Update only fields owned by this operation, retaining all other persisted data.
33
+ * Maps are replaced, not deep-merged, so callers can retire entries. An explicit
34
+ * undefined removes a field; omitted fields (including future extensions) survive.
35
+ */
36
+ export declare function writeManagedModelState(path: string, version: number, updates: Partial<ManagedModelState>): boolean;
@@ -8,6 +8,8 @@ import { type ExecutingPackageVersionResult } from '../package-version';
8
8
  import { installRequiredSkill } from '../skills';
9
9
  import type { HarnessAction, HarnessStatusReport, ModelConfigInput, ModelRoleInput, OperationApplyResult, OperationContext, OperationPlan } from './types';
10
10
  export interface CodexOperationContext extends OperationContext {
11
+ trustHooks?: boolean;
12
+ replaceLegacyAgents?: boolean;
11
13
  scope?: CodexInstallScope;
12
14
  homeDir?: string;
13
15
  codexHome?: string;
@@ -3,7 +3,7 @@ import type { HarnessInstallCompletionResult } from '../install-completion';
3
3
  import { type InstallHarnessId } from '../install-ledger';
4
4
  import type { EffortSelection } from '../model-effort';
5
5
  export type ManagedState = 'installed' | 'missing' | 'drift' | 'outdated' | 'unknown';
6
- export type OperationActionKind = 'status' | 'list' | 'install' | 'update' | 'sync' | 'repair' | 'model-config';
6
+ export type OperationActionKind = 'doctor' | 'uninstall' | 'status' | 'list' | 'install' | 'update' | 'sync' | 'repair' | 'model-config';
7
7
  export type ManagedTargetKind = 'file' | 'directory' | 'config' | 'skill' | 'hook' | 'memory-state' | 'generated-artifact' | 'package' | 'surface' | 'unknown';
8
8
  export type WarningSeverity = 'minor' | 'important' | 'critical';
9
9
  export interface OperationPath {
@@ -141,6 +141,7 @@ export declare function getPiExternalPackageSpecs(options?: Pick<PiSetupOptions,
141
141
  export declare function inspectPiSetupPackage(packages: readonly PiConfiguredPackage[], spec: PiSetupPackageSpec, requireManagedSource?: boolean): PiExternalPackageEvidence;
142
142
  export declare function piIncumbentTodoRecovery(source: string, scope: PiConfiguredPackage['scope'], identityLimitation?: string, unmappedSource?: boolean): string;
143
143
  export declare function resolvePiPreservationPackages(output: string, options: PiSetupOptions): PiConfiguredPackage[];
144
+ export declare function mergePiCodemodeSettings(current: Record<string, unknown>): Record<string, unknown>;
144
145
  export declare function mergePiSubagentsConfig(current: Record<string, unknown>): Record<string, unknown>;
145
146
  export declare function mergePiGrepMcpConfig(current: Record<string, unknown>): Record<string, unknown>;
146
147
  export declare function mergePiRootBlock(current: string, managedBlock: string): string;
@@ -0,0 +1,2 @@
1
+ /** Replace a file without following or clobbering pre-existing staging paths. */
2
+ export declare function safeAtomicWriteFileSync(path: string, content: string | Uint8Array): void;
@@ -2,10 +2,10 @@ import {
2
2
  defaultTuiOperations,
3
3
  effortChoicesForModel,
4
4
  listOperationHarnesses
5
- } from "../../chunk-7YCSKK2X.js";
5
+ } from "../../chunk-5LW4CNA5.js";
6
6
  import "../../chunk-62L3ORXN.js";
7
- import "../../chunk-U7FNFTM5.js";
8
- import "../../chunk-OW6I7ZUU.js";
7
+ import "../../chunk-P7R4GDSO.js";
8
+ import "../../chunk-4DZSWTUM.js";
9
9
 
10
10
  // src/cli/tui/index.tsx
11
11
  import { render } from "ink";
@@ -879,6 +879,8 @@ function App({
879
879
  const [previewAction, setPreviewAction] = useState(
880
880
  "cancel"
881
881
  );
882
+ const [hookTrustSelected, setHookTrustSelected] = useState(0);
883
+ const [pendingHookAction, setPendingHookAction] = useState("install");
882
884
  const [previewBackView, setPreviewBackView] = useState("harness");
883
885
  const [modelHarness, setModelHarness] = useState("codex");
884
886
  const [modelRoles, setModelRoles] = useState([]);
@@ -972,7 +974,7 @@ function App({
972
974
  setView("harness");
973
975
  } else if (view === "action") {
974
976
  setView("root");
975
- } else if (view === "preview") {
977
+ } else if (view === "preview" || view === "hookTrust") {
976
978
  setView(previewBackView);
977
979
  } else if (view === "modelRoles") {
978
980
  setView("manageHarness");
@@ -992,10 +994,16 @@ function App({
992
994
  function openPlan(harness, action, backView = "harness") {
993
995
  setActiveHarness(harness);
994
996
  setRestoringDefaults(false);
995
- setPlan(operations.plan(harness, action));
996
997
  setResult(void 0);
997
998
  setPreviewAction("cancel");
998
999
  setPreviewBackView(backView);
1000
+ if (harness === "codex" && (action === "install" || action === "update")) {
1001
+ setPendingHookAction(action);
1002
+ setHookTrustSelected(0);
1003
+ setView("hookTrust");
1004
+ return;
1005
+ }
1006
+ setPlan(operations.plan(harness, action));
999
1007
  setView("preview");
1000
1008
  }
1001
1009
  function openModelRoles(harness) {
@@ -1186,6 +1194,19 @@ function App({
1186
1194
  if (view !== "root") goBack();
1187
1195
  return;
1188
1196
  }
1197
+ if (view === "hookTrust") {
1198
+ if (key.upArrow || key.downArrow || input === "j" || input === "k")
1199
+ setHookTrustSelected((current) => current === 0 ? 1 : 0);
1200
+ if (key.return) {
1201
+ setPlan(
1202
+ operations.plan("codex", pendingHookAction, {
1203
+ trustHooks: hookTrustSelected === 1
1204
+ })
1205
+ );
1206
+ setView("preview");
1207
+ }
1208
+ return;
1209
+ }
1189
1210
  if (view === "root") {
1190
1211
  if (key.upArrow || input === "k") {
1191
1212
  setRootSelected((current) => moveSelection(current, -1, rootItems));
@@ -1484,6 +1505,36 @@ function App({
1484
1505
  )
1485
1506
  ] });
1486
1507
  }
1508
+ if (view === "hookTrust") {
1509
+ return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", children: [
1510
+ /* @__PURE__ */ jsx8(
1511
+ Header,
1512
+ {
1513
+ title: "Trust Codex hooks?",
1514
+ subtitle: "Trusted hooks can run outside the sandbox."
1515
+ }
1516
+ ),
1517
+ /* @__PURE__ */ jsx8(Text8, { children: "Trust thoth-agents SessionStart and SubagentStart hooks?" }),
1518
+ /* @__PURE__ */ jsx8(
1519
+ Menu,
1520
+ {
1521
+ items: [
1522
+ {
1523
+ id: "no",
1524
+ label: "No \u2014 review in Codex",
1525
+ detail: "Use /hooks or the startup Trust all and continue prompt."
1526
+ },
1527
+ {
1528
+ id: "yes",
1529
+ label: "Yes \u2014 trust plugin hooks",
1530
+ detail: "Consent to running outside the sandbox."
1531
+ }
1532
+ ],
1533
+ selected: hookTrustSelected
1534
+ }
1535
+ )
1536
+ ] });
1537
+ }
1487
1538
  if (view === "preview" && plan) {
1488
1539
  return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", children: [
1489
1540
  /* @__PURE__ */ jsx8(
@@ -9,7 +9,9 @@ export interface TuiOperations {
9
9
  providerCapability?(harness: HarnessId): Promise<ProviderCapabilityEvidence>;
10
10
  modelRoles(harness: HarnessId): ModelRoleInput[];
11
11
  modelOptions(harness: HarnessId): Promise<ModelOption[]>;
12
- plan(harness: HarnessId, action: Exclude<TuiAction, 'status' | 'list'>): OperationPlan;
12
+ plan(harness: HarnessId, action: Exclude<TuiAction, 'status' | 'list'>, options?: {
13
+ trustHooks?: boolean;
14
+ }): OperationPlan;
13
15
  modelPlan(harness: HarnessId, roles: ModelRoleInput[]): OperationPlan;
14
16
  restoreModelPlan(harness: HarnessId, options: readonly ModelOption[]): OperationPlan;
15
17
  apply(plan: OperationPlan): OperationApplyResult;
@@ -7,6 +7,7 @@ export interface InstallArgs {
7
7
  localPiRuntimeRoot?: string;
8
8
  tmux?: BooleanArg;
9
9
  dryRun?: boolean;
10
+ trustHooks?: boolean;
10
11
  reset?: boolean;
11
12
  }
12
13
  export interface GenerateArgs {
@@ -22,13 +23,15 @@ export interface CliModelRoleArg {
22
23
  effort?: EffortSelection;
23
24
  }
24
25
  export interface OperationArgs {
26
+ replaceLegacyAgents?: boolean;
25
27
  harness?: OperationHarnessArg;
26
28
  all?: boolean;
27
29
  apply?: boolean;
28
30
  dryRun?: boolean;
31
+ trustHooks?: boolean;
29
32
  roles: CliModelRoleArg[];
30
33
  }
31
- export type CliOperationCommand = 'status' | 'list' | 'update' | 'sync' | 'model';
34
+ export type CliOperationCommand = 'uninstall' | 'doctor' | 'status' | 'list' | 'update' | 'sync' | 'model';
32
35
  export type CliParseResult = {
33
36
  command: 'install';
34
37
  installArgs: InstallArgs;
@@ -4,7 +4,8 @@ export declare const SUBAGENT_NAMES: readonly ["explorer", "librarian", "oracle"
4
4
  export declare const ORCHESTRATOR_NAME: "orchestrator";
5
5
  export declare const ALL_AGENT_NAMES: readonly BuiltinAgentName[];
6
6
  export declare const SUBAGENT_DELEGATION_RULES: Record<AgentName, readonly string[]>;
7
- export declare const CONFIRMED_OPENAI_SUBAGENT_PRESET: {
7
+ /** Previous shipped defaults, retained only for upgrade comparison. */
8
+ export declare const LEGACY_OPENAI_PRESET: {
8
9
  readonly explorer: {
9
10
  readonly model: "gpt-6-luna";
10
11
  readonly effort: "low";
@@ -25,10 +26,36 @@ export declare const CONFIRMED_OPENAI_SUBAGENT_PRESET: {
25
26
  readonly model: "gpt-6-luna";
26
27
  readonly effort: "max";
27
28
  };
29
+ readonly orchestrator: {
30
+ readonly model: "gpt-6-sol";
31
+ readonly effort: "xhigh";
32
+ };
33
+ };
34
+ export declare const CONFIRMED_OPENAI_SUBAGENT_PRESET: {
35
+ readonly explorer: {
36
+ readonly model: "gpt-6-luna";
37
+ readonly effort: "max";
38
+ };
39
+ readonly librarian: {
40
+ readonly model: "gpt-6-luna";
41
+ readonly effort: "max";
42
+ };
43
+ readonly oracle: {
44
+ readonly model: "gpt-6.1-sol";
45
+ readonly effort: "xhigh";
46
+ };
47
+ readonly designer: {
48
+ readonly model: "gpt-6-luna";
49
+ readonly effort: "max";
50
+ };
51
+ readonly worker: {
52
+ readonly model: "gpt-6-luna";
53
+ readonly effort: "max";
54
+ };
28
55
  };
29
56
  export declare const OPENCODE_OPENAI_ORCHESTRATOR_PRESET: {
30
- readonly model: "gpt-6-sol";
31
- readonly effort: "xhigh";
57
+ readonly model: "gpt-6.1-sol";
58
+ readonly effort: "high";
32
59
  };
33
60
  export declare const DEFAULT_MODELS: Record<AgentName, string | undefined>;
34
61
  export declare function getDefaultOpenCodeModel(name: BuiltinAgentName): string;
@@ -54,6 +54,7 @@ export declare const AgentOverrideConfigSchema: z.ZodObject<{
54
54
  id: z.ZodString;
55
55
  variant: z.ZodOptional<z.ZodString>;
56
56
  }, z.core.$strip>]>>]>>;
57
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
57
58
  temperature: z.ZodOptional<z.ZodNumber>;
58
59
  steps: z.ZodOptional<z.ZodNumber>;
59
60
  variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
@@ -89,6 +90,7 @@ export declare const PresetSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
89
90
  id: z.ZodString;
90
91
  variant: z.ZodOptional<z.ZodString>;
91
92
  }, z.core.$strip>]>>]>>;
93
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
92
94
  temperature: z.ZodOptional<z.ZodNumber>;
93
95
  steps: z.ZodOptional<z.ZodNumber>;
94
96
  variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
@@ -180,6 +182,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
180
182
  id: z.ZodString;
181
183
  variant: z.ZodOptional<z.ZodString>;
182
184
  }, z.core.$strip>]>>]>>;
185
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
183
186
  temperature: z.ZodOptional<z.ZodNumber>;
184
187
  steps: z.ZodOptional<z.ZodNumber>;
185
188
  variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
@@ -189,6 +192,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
189
192
  id: z.ZodString;
190
193
  variant: z.ZodOptional<z.ZodString>;
191
194
  }, z.core.$strip>]>>]>>;
195
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
192
196
  temperature: z.ZodOptional<z.ZodNumber>;
193
197
  steps: z.ZodOptional<z.ZodNumber>;
194
198
  variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
@@ -13,7 +13,7 @@ export declare const CLAUDE_CODE_SUBAGENT_DEFAULT_MODELS: {
13
13
  readonly worker: "sonnet";
14
14
  };
15
15
  export declare const CLAUDE_CODE_SUBAGENT_DEFAULT_EFFORTS: {
16
- readonly explorer: "low";
16
+ readonly explorer: "medium";
17
17
  readonly designer: "medium";
18
18
  readonly worker: "medium";
19
19
  readonly librarian: "high";
@@ -0,0 +1,31 @@
1
+ export declare const LEGACY_CODEX_AGENT_ARTIFACTS: readonly [{
2
+ readonly harness: "codex";
3
+ readonly kind: "agent-config";
4
+ readonly path: ".codex/agents/thoth-agents-explorer.toml";
5
+ readonly description: "Codex agent definition for explorer.";
6
+ readonly content: "name = \"explorer\"\ndescription = \"Resolve broad or uncertain repository questions and return distilled evidence. Use when: Local source, effective flow, responsibility, repository ownership, or behavior is unknown or uncertain. Do not use when: Not for implementation, edits, or known narrow questions. Escalate when: Send external evidence to librarian and mutation scope to root. Mutation: read-only; never mutate the workspace. Verification: reports inspected paths, confidence, and remaining gaps Return: compact markdown fields: conclusion, evidence, verification, risks, openQuestions.\"\ndeveloper_instructions = \"\"\"\n<role>\nYou are explorer.\n</role>\n\n<mode>\n- Mode: read-only\n- Dispatch: collaboration.spawn_agent\n- Scope: local repository discovery\n</mode>\n\n<responsibility>\nResolve broad or uncertain repository questions and return distilled evidence.\n</responsibility>\n\n<routing-contract>\n- Use when: Local source, effective flow, responsibility, repository ownership, or behavior is unknown or uncertain.\n- Do not use when: Not for implementation, edits, or known narrow questions.\n- Escalate when: Send external evidence to librarian and mutation scope to root.\n- Verification: reports inspected paths, confidence, and remaining gaps\n</routing-contract>\n\n<reasoning-discipline>\n- Check the most likely failure mode and one meaningful alternative before acting.\n- Ground conclusions in current evidence and verify the assigned outcome before returning.\n</reasoning-discipline>\n\n<rules>\n- Do not mutate the workspace.\n- Do not create coordination artifacts.\n- Resolve the assigned repository question with paths, symbols, and concise anchors.\n- Search broadly only when the target is genuinely unknown; stop once the evidence is decision-ready.\n</rules>\n\n<evidence-only>\n- Report facts with evidence and uncertainty; never recommend fixes, designs, defaults or next actions.\n- Treat conclusion as a factual finding, not advice.\n- Return any open question you cannot settle through openQuestions as the question, the possible options and the facts for each option, without recommending one. Root decides or asks Oracle.\n</evidence-only>\n\n- Do not delegate further or call `functions.update_plan`; root owns progress.\n- Use terminating checks; avoid watch processes and indefinite waits.\n- Preserve operator-selected model/effort. Stop after the assigned outcome and checks; never expand scope to fill a timeout.\n- After two consecutive attempts without new evidence or progress, return partial evidence and the smallest blocker; do not repeat searches or unchanged failing commands.\n- Use exact supplied skill paths; report missing assets instead of searching the user home or installing replacements.\n- During edits use focused checks. Freeze relevant inputs before final validation; rerun only checks invalidated by later edits. Reuse fresh evidence for unchanged inputs, not full suites per child.\n- Use native command completion; no status/log polling merely to wait. Batch independent short reads/checks when supported; no extra process wrappers.\n- Reconcile owned background commands before returning. A late notification must preserve the substantive handoff, not replace it with a bare acknowledgment.\n- Never discard or overwrite unrelated working-tree changes.\n- `none`: no provider work; `recall`: bounded reads; `observe`: + bounded durable observation in scope.\n- `recall`/`observe`: installed `thoth-mem` skill; do not invent provider mechanics/claim unconfirmed effects.\n- Only dispatch identity, verbatim; never derive. If missing, report memory unavailable.\n- MEMORY: no workspace mutation or root lifecycle/real-user-intent authority.\n- `.thoth/`: work/specs/constitution/history—not provider memory; no artifact mirrors.\n- Report unavailable/degraded/stale/contradictory/insufficient memory; continue unrelated safe work.\n\n<questions>\nUse `request_user_input` only for a blocking material choice, destructive or security-sensitive action, or missing secret. Do safe non-blocked work first, then escalate the unresolved question to the root through openQuestions as the question, the possible options and the facts for each option, without recommending one.\n</questions>\n\n<return-contract>\nReturn compact markdown fields (no JSON): conclusion, evidence, verification, risks, openQuestions.\n</return-contract>\n\nBe concise. Return distilled evidence and outcomes, not raw logs or full-file dumps.\n\n<model-profile family=\"openai\">\n- Plan briefly, then act with explicit tool targets and return shapes.\n- Navigate from broad uncertainty to exact repository anchors.\n</model-profile>\n\n<role-operational-contract>\n- Permissions, memory governance, runtime hooks, and provider-per-agent controls are instruction-level unless the active Codex runtime documents stronger enforcement.\n- explorer runs as a Codex custom-agent TOML entry; the orchestrator remains the ambient Codex root session, not a generated role TOML.\n</role-operational-contract>\n\"\"\"\n\nmodel = \"gpt-6-luna\"\nmodel_reasoning_effort = \"max\"\nsandbox_mode = \"read-only\"\n";
7
+ }, {
8
+ readonly harness: "codex";
9
+ readonly kind: "agent-config";
10
+ readonly path: ".codex/agents/thoth-agents-librarian.toml";
11
+ readonly description: "Codex agent definition for librarian.";
12
+ readonly content: "name = \"librarian\"\ndescription = \"Gather current authoritative evidence and separate documented facts from inference. Use when: Current authoritative external evidence is required. Do not use when: Not for implementation, edits, or purely local discovery. Escalate when: Report contradictory or insufficient sources to root. Mutation: read-only; never mutate the workspace. Verification: provides direct sources for substantive external claims Return: compact markdown fields: conclusion, evidence, verification, risks, openQuestions.\"\ndeveloper_instructions = \"\"\"\n<role>\nYou are librarian.\n</role>\n\n<mode>\n- Mode: read-only\n- Dispatch: collaboration.spawn_agent\n- Scope: authoritative external research with local confirmation when needed\n</mode>\n\n<responsibility>\nGather current authoritative evidence and separate documented facts from inference.\n</responsibility>\n\n<routing-contract>\n- Use when: Current authoritative external evidence is required.\n- Do not use when: Not for implementation, edits, or purely local discovery.\n- Escalate when: Report contradictory or insufficient sources to root.\n- Verification: provides direct sources for substantive external claims\n</routing-contract>\n\n<reasoning-discipline>\n- Check the most likely failure mode and one meaningful alternative before acting.\n- Ground conclusions in current evidence and verify the assigned outcome before returning.\n</reasoning-discipline>\n\n<rules>\n- Do not mutate the workspace.\n- Do not create coordination artifacts.\n- Prefer current official documentation and primary sources.\n- Cite every substantive external claim and label inference explicitly.\n</rules>\n\n<evidence-only>\n- Report facts with evidence and uncertainty; never recommend fixes, designs, defaults or next actions.\n- Treat conclusion as a factual finding, not advice.\n- Return any open question you cannot settle through openQuestions as the question, the possible options and the facts for each option, without recommending one. Root decides or asks Oracle.\n</evidence-only>\n\n- Do not delegate further or call `functions.update_plan`; root owns progress.\n- Use terminating checks; avoid watch processes and indefinite waits.\n- Preserve operator-selected model/effort. Stop after the assigned outcome and checks; never expand scope to fill a timeout.\n- After two consecutive attempts without new evidence or progress, return partial evidence and the smallest blocker; do not repeat searches or unchanged failing commands.\n- Use exact supplied skill paths; report missing assets instead of searching the user home or installing replacements.\n- During edits use focused checks. Freeze relevant inputs before final validation; rerun only checks invalidated by later edits. Reuse fresh evidence for unchanged inputs, not full suites per child.\n- Use native command completion; no status/log polling merely to wait. Batch independent short reads/checks when supported; no extra process wrappers.\n- Reconcile owned background commands before returning. A late notification must preserve the substantive handoff, not replace it with a bare acknowledgment.\n- Never discard or overwrite unrelated working-tree changes.\n- `none`: no provider work; `recall`: bounded reads; `observe`: + bounded durable observation in scope.\n- `recall`/`observe`: installed `thoth-mem` skill; do not invent provider mechanics/claim unconfirmed effects.\n- Only dispatch identity, verbatim; never derive. If missing, report memory unavailable.\n- MEMORY: no workspace mutation or root lifecycle/real-user-intent authority.\n- `.thoth/`: work/specs/constitution/history—not provider memory; no artifact mirrors.\n- Report unavailable/degraded/stale/contradictory/insufficient memory; continue unrelated safe work.\n\n<questions>\nUse `request_user_input` only for a blocking material choice, destructive or security-sensitive action, or missing secret. Do safe non-blocked work first, then escalate the unresolved question to the root through openQuestions as the question, the possible options and the facts for each option, without recommending one.\n</questions>\n\n<return-contract>\nReturn compact markdown fields (no JSON): conclusion, evidence, verification, risks, openQuestions.\n</return-contract>\n\nBe concise. Return distilled evidence and outcomes, not raw logs or full-file dumps.\n\n<model-profile family=\"openai\">\n- Plan briefly, then act with explicit tool targets and return shapes.\n- Prioritize current primary sources, versions, and explicit citations.\n</model-profile>\n\n<role-operational-contract>\n- Permissions, memory governance, runtime hooks, and provider-per-agent controls are instruction-level unless the active Codex runtime documents stronger enforcement.\n- librarian runs as a Codex custom-agent TOML entry; the orchestrator remains the ambient Codex root session, not a generated role TOML.\n</role-operational-contract>\n\"\"\"\n\nmodel = \"gpt-6-luna\"\nmodel_reasoning_effort = \"max\"\nsandbox_mode = \"read-only\"\n";
13
+ }, {
14
+ readonly harness: "codex";
15
+ readonly kind: "agent-config";
16
+ readonly path: ".codex/agents/thoth-agents-oracle.toml";
17
+ readonly description: "Codex agent definition for oracle.";
18
+ readonly content: "name = \"oracle\"\ndescription = \"Independently review plans when selected and provide independent judgment for artifact-backed or material-risk final verification, exposing correctness risks and judging whether results satisfy their contracts. Use when: Selected focused plan review, persistent diagnosis, material architecture or security risk, contradictory evidence, high failure cost, or artifact-backed final verification needs independent judgment. Do not use when: Not for implementation, mutation, persistence, or self-review. Escalate when: Return blockers and remediation anchors to root. Mutation: read-only; never mutate the workspace. Verification: separates observations, risks, and recommendations Return: compact markdown fields: conclusion, evidence, verification, risks, openQuestions, nextAction. Only plan-review/final-verification uses a thoth-result gate envelope; diagnosis/advice cannot approve.\"\ndeveloper_instructions = \"\"\"\n<role>\nYou are oracle.\n</role>\n\n<mode>\n- Mode: read-only\n- Dispatch: collaboration.spawn_agent\n- Scope: diagnosis, architecture, optional focused plan review, and independent verification\n</mode>\n\n<responsibility>\nIndependently review plans when selected and provide independent judgment for artifact-backed or material-risk final verification, exposing correctness risks and judging whether results satisfy their contracts.\n</responsibility>\n\n<routing-contract>\n- Use when: Selected focused plan review, persistent diagnosis, material architecture or security risk, contradictory evidence, high failure cost, or artifact-backed final verification needs independent judgment.\n- Do not use when: Not for implementation, mutation, persistence, or self-review.\n- Escalate when: Return blockers and remediation anchors to root.\n- Verification: separates observations, risks, and recommendations\n</routing-contract>\n\n<reasoning-discipline>\n- Check the most likely failure mode and one meaningful alternative before acting.\n- Ground conclusions in current evidence and verify the assigned outcome before returning.\n</reasoning-discipline>\n\n<rules>\n- Do not mutate the workspace.\n- Do not create coordination artifacts.\n- Separate observations, risks and recommendations; review stated requirements/contracts, not invented scope.\n- For plan review or final verify, load matching bundled thoth-sdd guidance; remain read-only.\n- Reject self-review: implementing root/writer cannot substitute for independent oracle judgment.\n</rules>\n\n- Do not delegate further or call `functions.update_plan`; root owns progress.\n- Use terminating checks; avoid watch processes and indefinite waits.\n- Preserve operator-selected model/effort. Stop after the assigned outcome and checks; never expand scope to fill a timeout.\n- After two consecutive attempts without new evidence or progress, return partial evidence and the smallest blocker; do not repeat searches or unchanged failing commands.\n- Use exact supplied skill paths; report missing assets instead of searching the user home or installing replacements.\n- During edits use focused checks. Freeze relevant inputs before final validation; rerun only checks invalidated by later edits. Reuse fresh evidence for unchanged inputs, not full suites per child.\n- Use native command completion; no status/log polling merely to wait. Batch independent short reads/checks when supported; no extra process wrappers.\n- Reconcile owned background commands before returning. A late notification must preserve the substantive handoff, not replace it with a bare acknowledgment.\n- Never discard or overwrite unrelated working-tree changes.\n- `none`: no provider work; `recall`: bounded reads; `observe`: + bounded durable observation in scope.\n- `recall`/`observe`: installed `thoth-mem` skill; do not invent provider mechanics/claim unconfirmed effects.\n- Only dispatch identity, verbatim; never derive. If missing, report memory unavailable.\n- MEMORY: no workspace mutation or root lifecycle/real-user-intent authority.\n- `.thoth/`: work/specs/constitution/history—not provider memory; no artifact mirrors.\n- Report unavailable/degraded/stale/contradictory/insufficient memory; continue unrelated safe work.\n\n<questions>\nUse `request_user_input` only for a blocking material choice, destructive or security-sensitive action, or missing secret. Do safe non-blocked work first and ask one targeted question with a recommended default.\n</questions>\n\n<return-contract>\nReturn compact markdown fields (no JSON): conclusion, evidence, verification, risks, openQuestions, nextAction.\nDiagnosis/advice uses markdown fields and cannot approve. Only for assigned plan-review or final-verification, instead return exactly one fenced ```thoth-result JSON block and nothing else. Types: s=string, s+=nonempty string, hex64=64 lowercase hex. No extra keys; ?=optional. evidenceIds reference unique evidence IDs.\n- schemaVersion: 1\n- role: \"oracle\"\n- status: complete|partial|blocked|failed\n- conclusion: s\n- evidence: {id: s+, kind: s, locator: s, claim: s, basis: observed|inferred, uncertainty: s}[]\n- verification: {check: s, method: s, outcome: pass|fail|not-run, evidenceIds: s[], reason: s}[]\n- risks: {description: s, severity: low|medium|high|critical, blocking: boolean, evidenceIds: s[]}[]\n- openQuestions: {question: s, owner: s, options: s[], facts: s[]}[]\n- nextAction: s|null\n- review: {kind: plan-review|final-verification, verdict: s, reviewedRecord?: s+, reviewedRecordSha256?: hex64}\nplan-review: OKAY|REJECT; final-verification: PASS|FAIL|BLOCKED; OKAY|PASS requires complete status and no blocking risks. Final-verification requires reviewedRecord and reviewedRecordSha256 if the assignment names a record; otherwise omit both.\n</return-contract>\n\nBe concise. Return distilled evidence and outcomes, not raw logs or full-file dumps.\n\n<model-profile family=\"openai\">\n- Plan briefly, then act with explicit tool targets and return shapes.\n- Challenge assumptions and return evidence-backed judgment.\n</model-profile>\n\n<role-operational-contract>\n- Permissions, memory governance, runtime hooks, and provider-per-agent controls are instruction-level unless the active Codex runtime documents stronger enforcement.\n- oracle runs as a Codex custom-agent TOML entry; the orchestrator remains the ambient Codex root session, not a generated role TOML.\n</role-operational-contract>\n\"\"\"\n\nmodel = \"gpt-6.1-sol\"\nmodel_reasoning_effort = \"xhigh\"\nsandbox_mode = \"read-only\"\n";
19
+ }, {
20
+ readonly harness: "codex";
21
+ readonly kind: "agent-config";
22
+ readonly path: ".codex/agents/thoth-agents-designer.toml";
23
+ readonly description: "Codex agent definition for designer.";
24
+ readonly content: "name = \"designer\"\ndescription = \"Own user-facing implementation choices and visual quality for UI work. Use when: User-facing UI/UX, interaction, accessibility, or visual quality is material. Do not use when: Not for backend-only, non-visual, or correctness-heavy cross-cutting work. Escalate when: Escalate coupled contracts, migrations, or high risk to worker. Mutation: only the assigned UI/UX decisions, implementation, and visual verification surface. Verification: includes visual verification when applicable Return: compact markdown fields: conclusion, evidence, verification, risks, openQuestions, nextAction, changedFiles.\"\ndeveloper_instructions = \"\"\"\n<role>\nYou are designer.\n</role>\n\n<mode>\n- Mode: write-capable\n- Dispatch: collaboration.spawn_agent\n- Scope: UI/UX decisions, implementation, and visual verification\n</mode>\n\n<responsibility>\nOwn user-facing implementation choices and visual quality for UI work.\n</responsibility>\n\n<routing-contract>\n- Use when: User-facing UI/UX, interaction, accessibility, or visual quality is material.\n- Do not use when: Not for backend-only, non-visual, or correctness-heavy cross-cutting work.\n- Escalate when: Escalate coupled contracts, migrations, or high risk to worker.\n- Verification: includes visual verification when applicable\n</routing-contract>\n\n<reasoning-discipline>\n- Check the most likely failure mode and one meaningful alternative before acting.\n- Ground conclusions in current evidence and verify the assigned outcome before returning.\n</reasoning-discipline>\n\n<rules>\n- Edit only the assigned work-unit surface.\n- Preserve unrelated working-tree changes and never use destructive Git cleanup.\n- Use local judgment to complete the accepted outcome within the assigned boundaries.\n- If a new independently acceptable outcome or material scope change appears, return bounded progress for root reassessment before expanding.\n- Own user-facing choices, implementation, and visual verification.\n- Check relevant responsive and interaction states when feasible.\n</rules>\n\n- Do not delegate further or call `functions.update_plan`; root owns progress.\n- Use terminating checks; avoid watch processes and indefinite waits.\n- Preserve operator-selected model/effort. Stop after the assigned outcome and checks; never expand scope to fill a timeout.\n- After two consecutive attempts without new evidence or progress, return partial evidence and the smallest blocker; do not repeat searches or unchanged failing commands.\n- Use exact supplied skill paths; report missing assets instead of searching the user home or installing replacements.\n- During edits use focused checks. Freeze relevant inputs before final validation; rerun only checks invalidated by later edits. Reuse fresh evidence for unchanged inputs, not full suites per child.\n- Use native command completion; no status/log polling merely to wait. Batch independent short reads/checks when supported; no extra process wrappers.\n- Reconcile owned background commands before returning. A late notification must preserve the substantive handoff, not replace it with a bare acknowledgment.\n- Never discard or overwrite unrelated working-tree changes.\n- `none`: no provider work; `recall`: bounded reads; `observe`: + bounded durable observation in scope.\n- `recall`/`observe`: installed `thoth-mem` skill; do not invent provider mechanics/claim unconfirmed effects.\n- Only dispatch identity, verbatim; never derive. If missing, report memory unavailable.\n- MEMORY: no workspace mutation or root lifecycle/real-user-intent authority.\n- `.thoth/`: work/specs/constitution/history—not provider memory; no artifact mirrors.\n- Report unavailable/degraded/stale/contradictory/insufficient memory; continue unrelated safe work.\n\n<questions>\nUse `request_user_input` only for a blocking material choice, destructive or security-sensitive action, or missing secret. Do safe non-blocked work first and ask one targeted question with a recommended default.\n</questions>\n\n<return-contract>\nReturn compact markdown fields (no JSON): conclusion, evidence, verification, risks, openQuestions, nextAction, changedFiles.\n</return-contract>\n\nBe concise. Return distilled evidence and outcomes, not raw logs or full-file dumps.\n\n<model-profile family=\"openai\">\n- Plan briefly, then act with explicit tool targets and return shapes.\n- Make concrete UX choices and verify the visible result.\n</model-profile>\n\n<role-operational-contract>\n- Permissions, memory governance, runtime hooks, and provider-per-agent controls are instruction-level unless the active Codex runtime documents stronger enforcement.\n- designer runs as a Codex custom-agent TOML entry; the orchestrator remains the ambient Codex root session, not a generated role TOML.\n</role-operational-contract>\n\"\"\"\n\nmodel = \"gpt-6-luna\"\nmodel_reasoning_effort = \"max\"\nsandbox_mode = \"workspace-write\"\n";
25
+ }, {
26
+ readonly harness: "codex";
27
+ readonly kind: "agent-config";
28
+ readonly path: ".codex/agents/thoth-agents-worker.toml";
29
+ readonly description: "Codex agent definition for worker.";
30
+ readonly content: "name = \"worker\"\ndescription = \"Handle bounded nonvisual implementation with full local context, including exact low-risk edits and correctness-critical, multi-file, edge-case-heavy, or high-risk work. Use when: Known bounded nonvisual implementation is ready, regardless of complexity; root direct work is limited to the bounded implementation-ownership exceptions. Correctness-critical work may be multi-file, edge-case-heavy, migration, concurrency, shared-contract, or high-risk. Do not use when: Not for visual-only work, reviewed commits, or work explicitly retained by the user in root. Escalate when: Return product or architecture choices to root. Mutation: only the assigned bounded nonvisual implementation and verification surface. Verification: reports focused checks and relevant edge-case evidence Return: compact markdown fields: conclusion, evidence, verification, risks, openQuestions, nextAction, changedFiles.\"\ndeveloper_instructions = \"\"\"\n<role>\nYou are worker.\n</role>\n\n<mode>\n- Mode: write-capable\n- Dispatch: collaboration.spawn_agent\n- Scope: bounded nonvisual implementation and verification\n</mode>\n\n<responsibility>\nHandle bounded nonvisual implementation with full local context, including exact low-risk edits and correctness-critical, multi-file, edge-case-heavy, or high-risk work.\n</responsibility>\n\n<routing-contract>\n- Use when: Known bounded nonvisual implementation is ready, regardless of complexity; root direct work is limited to the bounded implementation-ownership exceptions. Correctness-critical work may be multi-file, edge-case-heavy, migration, concurrency, shared-contract, or high-risk.\n- Do not use when: Not for visual-only work, reviewed commits, or work explicitly retained by the user in root.\n- Escalate when: Return product or architecture choices to root.\n- Verification: reports focused checks and relevant edge-case evidence\n</routing-contract>\n\n<reasoning-discipline>\n- Check the most likely failure mode and one meaningful alternative before acting.\n- Ground conclusions in current evidence and verify the assigned outcome before returning.\n</reasoning-discipline>\n\n<rules>\n- Edit only the assigned work-unit surface.\n- Preserve unrelated working-tree changes and never use destructive Git cleanup.\n- Use local judgment to complete the accepted outcome within the assigned boundaries.\n- If a new independently acceptable outcome or material scope change appears, return bounded progress for root reassessment before expanding.\n- Start at supplied entrypoints; read further only to resolve a concrete missing fact. Use tests first for behavior changes.\n- Verify relevant call sites and shared contracts within the assigned outcome; do not restart broad discovery or unrelated cleanup.\n</rules>\n\n- Do not delegate further or call `functions.update_plan`; root owns progress.\n- Use terminating checks; avoid watch processes and indefinite waits.\n- Preserve operator-selected model/effort. Stop after the assigned outcome and checks; never expand scope to fill a timeout.\n- After two consecutive attempts without new evidence or progress, return partial evidence and the smallest blocker; do not repeat searches or unchanged failing commands.\n- Use exact supplied skill paths; report missing assets instead of searching the user home or installing replacements.\n- During edits use focused checks. Freeze relevant inputs before final validation; rerun only checks invalidated by later edits. Reuse fresh evidence for unchanged inputs, not full suites per child.\n- Use native command completion; no status/log polling merely to wait. Batch independent short reads/checks when supported; no extra process wrappers.\n- Reconcile owned background commands before returning. A late notification must preserve the substantive handoff, not replace it with a bare acknowledgment.\n- Never discard or overwrite unrelated working-tree changes.\n- `none`: no provider work; `recall`: bounded reads; `observe`: + bounded durable observation in scope.\n- `recall`/`observe`: installed `thoth-mem` skill; do not invent provider mechanics/claim unconfirmed effects.\n- Only dispatch identity, verbatim; never derive. If missing, report memory unavailable.\n- MEMORY: no workspace mutation or root lifecycle/real-user-intent authority.\n- `.thoth/`: work/specs/constitution/history—not provider memory; no artifact mirrors.\n- Report unavailable/degraded/stale/contradictory/insufficient memory; continue unrelated safe work.\n\n<questions>\nUse `request_user_input` only for a blocking material choice, destructive or security-sensitive action, or missing secret. Do safe non-blocked work first and ask one targeted question with a recommended default.\n</questions>\n\n<return-contract>\nReturn compact markdown fields (no JSON): conclusion, evidence, verification, risks, openQuestions, nextAction, changedFiles.\n</return-contract>\n\nBe concise. Return distilled evidence and outcomes, not raw logs or full-file dumps.\n\n<model-profile family=\"openai\">\n- Plan briefly, then act with explicit tool targets and return shapes.\n- Trace shared behavior, test assumptions, and verify edge cases.\n</model-profile>\n\n<role-operational-contract>\n- Permissions, memory governance, runtime hooks, and provider-per-agent controls are instruction-level unless the active Codex runtime documents stronger enforcement.\n- worker runs as a Codex custom-agent TOML entry; the orchestrator remains the ambient Codex root session, not a generated role TOML.\n</role-operational-contract>\n\"\"\"\n\nmodel = \"gpt-6-luna\"\nmodel_reasoning_effort = \"max\"\nsandbox_mode = \"workspace-write\"\n";
31
+ }];
@@ -13,7 +13,7 @@ export interface CodexSurfaceRecord {
13
13
  evidence: string;
14
14
  fallback?: 'instruction-only' | 'diagnostic-only' | 'none';
15
15
  }
16
- export type CodexHookEvent = 'SessionStart' | 'UserPromptSubmit' | 'PreToolUse' | 'PermissionRequest' | 'PostToolUse' | 'Stop';
16
+ export type CodexHookEvent = 'SessionStart' | 'SubagentStart' | 'UserPromptSubmit' | 'PreToolUse' | 'PermissionRequest' | 'PostToolUse' | 'Stop';
17
17
  export type CodexHookHandlerType = 'command' | 'prompt' | 'agent';
18
18
  export interface CodexHookValidationInput {
19
19
  event: string;
@@ -1,9 +1,11 @@
1
1
  import { type PluginConfig } from '../../config';
2
- import type { HarnessAdapter, HarnessCapabilities, HarnessRenderContext } from '../types';
2
+ import type { HarnessAdapter, HarnessArtifact, HarnessCapabilities, HarnessRenderContext } from '../types';
3
3
  export interface CodexRenderContext extends HarnessRenderContext {
4
4
  config?: PluginConfig;
5
5
  packageRoot?: string;
6
6
  }
7
7
  export declare const CODEX_CAPABILITIES: HarnessCapabilities;
8
8
  export declare function renderCodexRootInstructions(config?: PluginConfig): string;
9
+ /** @internal Exact pre-hook rendering, retained only for ownership attribution. */
10
+ export declare function renderLegacyCodexAgentArtifacts(): HarnessArtifact[];
9
11
  export declare const codexAdapter: HarnessAdapter;
@@ -0,0 +1,2 @@
1
+ /** Canonical CommonJS runtime emitted into the Codex-only plugin hook directory. */
2
+ export declare function renderCodexHookScript(roleNames: readonly string[]): string;
@@ -1,3 +1,5 @@
1
+ export type { OracleReview, OracleReviewKind, ResultCommon, SpecialistResult, SpecialistRole, } from './result-contract';
2
+ export { getSpecialistResultFields, SPECIALIST_RESULT_CONTRACT, } from './result-contract';
1
3
  export type AgentRoleName = 'orchestrator' | 'explorer' | 'librarian' | 'oracle' | 'designer' | 'worker';
2
4
  export type AgentMutationMode = 'adaptive-root' | 'read-only' | 'write-capable';
3
5
  export type AgentDispatchMethod = 'root-coordinator' | 'task';
@@ -146,16 +148,20 @@ export declare const AGENT_ROLES: readonly [{
146
148
  }];
147
149
  export declare function getImplementationOwnershipInstructions(policy: ImplementationOwnershipPolicy): string[];
148
150
  export declare const ORCHESTRATION_POLICY: OrchestrationPolicy;
151
+ export declare const DEFAULT_DELEGATION_LIFECYCLE = "- New objectives, phases, work units, mutable surfaces or independent judgments require fresh specialist sessions via {{lifecycleFreshDelegation}}; {{lifecycleIndependentContext}}. These are fresh-session boundaries, not permission for root execution; completed agents are not a reusable role pool.\n- Use {{lifecycleSameAssignmentContinuation}} only to steer, complete or clarify the same bounded assignment.\n- {{lifecycleSameSessionProbe}} only collects the active nonterminal assignment.\n- Every Oracle plan review, verification round, and PASS judgment uses a fresh Oracle instance. Existing ones only clarify their findings.";
152
+ export declare const CODEX_DELEGATION_LIFECYCLE: string;
149
153
  export declare const AGENT_RETURN_CONTRACT: {
150
154
  readonly orchestrator: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions", "nextAction"];
151
155
  readonly explorer: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions"];
152
156
  readonly librarian: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions"];
153
157
  readonly oracle: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions", "nextAction"];
154
- readonly designer: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions", "nextAction"];
155
- readonly worker: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions", "nextAction"];
158
+ readonly designer: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions", "nextAction", "changedFiles"];
159
+ readonly worker: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions", "nextAction", "changedFiles"];
156
160
  };
157
161
  export declare const VERIFICATION_PROTOCOL: readonly ["Completion reports identify changed files and verification evidence.", "Behavior changes receive the smallest sufficient automated check or a declared manual check.", "Visual changes receive designer-owned visual QA when applicable."];
158
162
  export declare const AGENT_PACK_CONTRACT: AgentPackContract;
159
163
  export declare function getAgentRole(name: AgentRoleName): AgentRoleContract;
164
+ /** Keep non-gate returns independent of the Oracle validator contract. */
165
+ export declare function renderSpecialistResultContract(role: Exclude<AgentRoleName, 'orchestrator'>): string;
160
166
  export declare function renderAgentRoutingDescription(role: AgentRoleContract): string;
161
167
  export declare function getAgentPackContract(): AgentPackContract;