@gajae-code/coding-agent 0.8.2 → 0.9.1
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 +53 -0
- package/dist/types/append-only-mode.d.ts +31 -0
- package/dist/types/capability/rule.d.ts +8 -0
- package/dist/types/cli/fixture-report.d.ts +20 -0
- package/dist/types/cli/fixture-report.test.d.ts +1 -0
- package/dist/types/cli/nofile-limit.d.ts +11 -0
- package/dist/types/cli/update-cli.d.ts +22 -0
- package/dist/types/config/settings-schema.d.ts +119 -1
- package/dist/types/discovery/index.d.ts +1 -0
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/export/ttsr.d.ts +14 -3
- package/dist/types/gjc-runtime/deep-interview-state.d.ts +5 -2
- package/dist/types/gjc-runtime/session-state-sidecar.d.ts +7 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +3 -0
- package/dist/types/gjc-runtime/team-runtime.d.ts +26 -0
- package/dist/types/gjc-runtime/tmux-common.d.ts +1 -0
- package/dist/types/gjc-runtime/ultragoal-receipt-freshness.d.ts +42 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +119 -13
- package/dist/types/goals/runtime.d.ts +1 -0
- package/dist/types/hooks/native-skill-hook.d.ts +12 -0
- package/dist/types/modes/components/assistant-message.d.ts +5 -1
- package/dist/types/modes/components/status-line.d.ts +9 -0
- package/dist/types/modes/components/thinking-selector.d.ts +2 -2
- package/dist/types/modes/controllers/command-controller.d.ts +1 -0
- package/dist/types/modes/controllers/event-controller.d.ts +5 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +4 -0
- package/dist/types/modes/rpc/rpc-mode.d.ts +1 -3
- package/dist/types/modes/rpc/rpc-socket-security.d.ts +3 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +14 -0
- package/dist/types/modes/shared/agent-wire/event-contract.d.ts +19 -0
- package/dist/types/modes/shared/agent-wire/event-envelope.d.ts +23 -1
- package/dist/types/modes/types.d.ts +3 -0
- package/dist/types/modes/utils/injected-user-submission.d.ts +52 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +1 -0
- package/dist/types/notifications/config-commands.d.ts +9 -0
- package/dist/types/notifications/config.d.ts +22 -0
- package/dist/types/notifications/index.d.ts +2 -0
- package/dist/types/notifications/lifecycle-commands.d.ts +1 -0
- package/dist/types/notifications/lifecycle-control-runtime.d.ts +2 -1
- package/dist/types/notifications/reply-sent-store.d.ts +53 -0
- package/dist/types/notifications/rich-draft.d.ts +68 -0
- package/dist/types/notifications/rich-render.d.ts +90 -0
- package/dist/types/notifications/telegram-daemon-cli.d.ts +3 -3
- package/dist/types/notifications/telegram-daemon.d.ts +30 -0
- package/dist/types/notifications/telegram-reference.d.ts +7 -0
- package/dist/types/notifications/threaded-render.d.ts +14 -0
- package/dist/types/sdk.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +43 -1
- package/dist/types/session/file-mention-pruning.d.ts +8 -0
- package/dist/types/session/messages.d.ts +4 -0
- package/dist/types/session/session-manager.d.ts +17 -1
- package/dist/types/skill-state/active-state.d.ts +18 -1
- package/dist/types/system-prompt.d.ts +18 -2
- package/dist/types/task/executor.d.ts +1 -0
- package/dist/types/task/fork-context-budget.d.ts +7 -0
- package/dist/types/task/token-log.d.ts +30 -0
- package/dist/types/task/token-log.test.d.ts +1 -0
- package/dist/types/tools/bisect.d.ts +81 -0
- package/dist/types/tools/index.d.ts +1 -0
- package/dist/types/tools/search.d.ts +2 -2
- package/dist/types/utils/file-mentions.d.ts +14 -0
- package/dist/types/utils/git.d.ts +32 -0
- package/dist/types/utils/pasted-image-path.d.ts +30 -0
- package/dist/types/web/scrapers/youtube.d.ts +8 -0
- package/package.json +8 -11
- package/src/append-only-mode.ts +58 -0
- package/src/autoresearch/prompt.md +1 -1
- package/src/autoresearch/tools/log-experiment.ts +1 -1
- package/src/capability/rule.ts +9 -0
- package/src/cli/config-cli.ts +27 -3
- package/src/cli/fixture-report.test.ts +230 -0
- package/src/cli/fixture-report.ts +171 -0
- package/src/cli/nofile-limit.ts +48 -0
- package/src/cli/notify-cli.ts +11 -9
- package/src/cli/update-cli.ts +85 -9
- package/src/cli.ts +26 -0
- package/src/commands/contribution-prep.ts +1 -1
- package/src/config/keybindings.ts +1 -1
- package/src/config/settings-schema.ts +76 -1
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +12 -13
- package/src/defaults/gjc/skills/ralplan/SKILL.md +30 -93
- package/src/defaults/gjc/skills/team/SKILL.md +16 -13
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +59 -4
- package/src/defaults/gjc/skills/ultragoal/pipeline-validation-contracts.md +30 -0
- package/src/defaults/gjc-defaults.ts +9 -0
- package/src/discovery/helpers.ts +10 -0
- package/src/discovery/index.ts +1 -0
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +60 -2
- package/src/export/ttsr.ts +96 -18
- package/src/extensibility/extensions/runner.ts +181 -219
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +156 -44
- package/src/gjc-runtime/deep-interview-state.ts +31 -2
- package/src/gjc-runtime/launch-tmux.ts +6 -0
- package/src/gjc-runtime/session-state-sidecar.ts +208 -13
- package/src/gjc-runtime/state-writer.ts +15 -0
- package/src/gjc-runtime/team-runtime.ts +175 -19
- package/src/gjc-runtime/tmux-common.ts +1 -0
- package/src/gjc-runtime/ultragoal-guard.ts +55 -66
- package/src/gjc-runtime/ultragoal-receipt-freshness.ts +315 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +1602 -143
- package/src/gjc-runtime/workflow-manifest.generated.json +113 -2
- package/src/gjc-runtime/workflow-manifest.ts +74 -1
- package/src/goals/runtime.ts +10 -2
- package/src/hindsight/backend.ts +1 -3
- package/src/hooks/native-skill-hook.ts +95 -4
- package/src/internal-urls/docs-index.generated.ts +18 -9
- package/src/lsp/client.ts +1 -0
- package/src/main.ts +43 -2
- package/src/memories/index.ts +12 -1
- package/src/modes/components/assistant-message.ts +241 -82
- package/src/modes/components/custom-editor.ts +1 -0
- package/src/modes/components/footer.ts +7 -2
- package/src/modes/components/status-line.ts +167 -54
- package/src/modes/components/thinking-selector.ts +10 -8
- package/src/modes/components/tool-execution.ts +44 -19
- package/src/modes/controllers/command-controller.ts +39 -2
- package/src/modes/controllers/event-controller.ts +77 -49
- package/src/modes/controllers/extension-ui-controller.ts +8 -1
- package/src/modes/controllers/input-controller.ts +13 -18
- package/src/modes/controllers/selector-controller.ts +41 -0
- package/src/modes/interactive-mode.ts +14 -1
- package/src/modes/rpc/rpc-mode.ts +32 -12
- package/src/modes/rpc/rpc-socket-security.ts +13 -1
- package/src/modes/rpc/rpc-types.ts +9 -0
- package/src/modes/shared/agent-wire/command-validation.ts +4 -0
- package/src/modes/shared/agent-wire/event-contract.ts +22 -0
- package/src/modes/shared/agent-wire/event-envelope.ts +82 -0
- package/src/modes/shared/agent-wire/scopes.ts +1 -0
- package/src/modes/types.ts +3 -0
- package/src/modes/utils/injected-user-submission.ts +94 -0
- package/src/modes/utils/ui-helpers.ts +17 -4
- package/src/notifications/config-commands.ts +20 -0
- package/src/notifications/config.ts +43 -4
- package/src/notifications/index.ts +105 -9
- package/src/notifications/lifecycle-commands.ts +37 -16
- package/src/notifications/lifecycle-control-runtime.ts +8 -3
- package/src/notifications/reply-sent-store.ts +134 -0
- package/src/notifications/rich-draft.ts +107 -0
- package/src/notifications/rich-render.ts +142 -0
- package/src/notifications/telegram-daemon-cli.ts +54 -7
- package/src/notifications/telegram-daemon-control.ts +2 -2
- package/src/notifications/telegram-daemon.ts +390 -56
- package/src/notifications/telegram-reference.ts +17 -0
- package/src/notifications/threaded-render.ts +45 -2
- package/src/prompts/agents/architect.md +19 -10
- package/src/prompts/agents/critic.md +16 -18
- package/src/prompts/agents/executor.md +14 -11
- package/src/prompts/agents/planner.md +18 -13
- package/src/prompts/ci-green-request.md +3 -8
- package/src/prompts/goals/goal-continuation.md +0 -5
- package/src/prompts/goals/goal-mode-active.md +0 -5
- package/src/prompts/system/agent-creation-architect.md +2 -2
- package/src/prompts/system/plan-mode-active.md +1 -1
- package/src/prompts/system/plan-mode-subagent.md +3 -3
- package/src/prompts/system/project-prompt.md +0 -13
- package/src/prompts/system/subagent-system-prompt.md +3 -2
- package/src/prompts/system/system-prompt.md +26 -19
- package/src/prompts/system/volatile-project-context.md +10 -0
- package/src/prompts/system/web-search.md +4 -7
- package/src/prompts/tools/apply-patch.md +6 -0
- package/src/prompts/tools/ast-edit.md +1 -0
- package/src/prompts/tools/bash.md +1 -1
- package/src/prompts/tools/bisect.md +22 -0
- package/src/prompts/tools/browser.md +1 -1
- package/src/prompts/tools/cron.md +0 -2
- package/src/prompts/tools/eval.md +2 -2
- package/src/prompts/tools/find.md +1 -1
- package/src/prompts/tools/github.md +6 -6
- package/src/prompts/tools/goal.md +1 -3
- package/src/prompts/tools/image-gen.md +12 -5
- package/src/prompts/tools/irc.md +5 -4
- package/src/prompts/tools/job.md +2 -2
- package/src/prompts/tools/lsp.md +1 -1
- package/src/prompts/tools/monitor.md +2 -2
- package/src/prompts/tools/patch.md +2 -2
- package/src/prompts/tools/replace.md +2 -21
- package/src/prompts/tools/rewind.md +1 -1
- package/src/prompts/tools/search-tool-bm25.md +6 -11
- package/src/prompts/tools/search.md +1 -1
- package/src/prompts/tools/skill.md +3 -2
- package/src/prompts/tools/ssh.md +2 -1
- package/src/prompts/tools/subagent.md +2 -2
- package/src/prompts/tools/task.md +4 -5
- package/src/prompts/tools/todo-write.md +1 -1
- package/src/prompts/tools/vim.md +1 -0
- package/src/prompts/tools/web-search.md +2 -0
- package/src/prompts/tools/write.md +8 -2
- package/src/sdk.ts +68 -30
- package/src/session/agent-session.ts +734 -107
- package/src/session/file-mention-pruning.ts +64 -0
- package/src/session/messages.ts +4 -0
- package/src/session/session-manager.ts +59 -2
- package/src/skill-state/active-state.ts +141 -5
- package/src/skill-state/deep-interview-mutation-guard.ts +67 -3
- package/src/slash-commands/builtin-registry.ts +143 -1
- package/src/system-prompt.ts +57 -16
- package/src/task/executor.ts +125 -20
- package/src/task/fork-context-advisory.ts +2 -7
- package/src/task/fork-context-budget.ts +9 -0
- package/src/task/index.ts +4 -3
- package/src/task/output-manager.ts +4 -2
- package/src/task/token-log.test.ts +188 -0
- package/src/task/token-log.ts +179 -0
- package/src/tools/bisect.ts +367 -0
- package/src/tools/index.ts +3 -0
- package/src/tools/output-meta.ts +116 -4
- package/src/tools/search.ts +8 -2
- package/src/tools/skill.ts +15 -0
- package/src/utils/file-mentions.ts +39 -7
- package/src/utils/git.ts +73 -0
- package/src/utils/pasted-image-path.ts +170 -0
- package/src/web/scrapers/youtube.ts +24 -12
|
@@ -61,7 +61,7 @@ declare module "@gajae-code/tui" {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export function defaultMessageQueueKeysForPlatform(platform: NodeJS.Platform = process.platform): KeyId {
|
|
64
|
-
return platform === "win32" ? "alt+q" : "alt+enter";
|
|
64
|
+
return platform === "win32" || platform === "darwin" ? "alt+q" : "alt+enter";
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
@@ -258,6 +258,8 @@ export const SETTINGS_SCHEMA = {
|
|
|
258
258
|
"notifications.enabled": { type: "boolean", default: false },
|
|
259
259
|
"notifications.telegram.botToken": { type: "string", default: undefined },
|
|
260
260
|
"notifications.telegram.chatId": { type: "string", default: undefined },
|
|
261
|
+
"notifications.telegram.rich.enabled": { type: "boolean", default: true },
|
|
262
|
+
"notifications.telegram.richDraft.enabled": { type: "boolean", default: false },
|
|
261
263
|
"notifications.discord.botToken": { type: "string", default: undefined },
|
|
262
264
|
"notifications.discord.channelId": { type: "string", default: undefined },
|
|
263
265
|
"notifications.slack.botToken": { type: "string", default: undefined },
|
|
@@ -545,6 +547,42 @@ export const SETTINGS_SCHEMA = {
|
|
|
545
547
|
],
|
|
546
548
|
},
|
|
547
549
|
},
|
|
550
|
+
|
|
551
|
+
"tools.readArtifactSpillThreshold": {
|
|
552
|
+
type: "number",
|
|
553
|
+
default: 0,
|
|
554
|
+
ui: {
|
|
555
|
+
tab: "tools",
|
|
556
|
+
label: "Experimental read-tool artifact spill threshold (KB)",
|
|
557
|
+
description:
|
|
558
|
+
"Advanced opt-in only: combined-size cap for `read` output across all requested ranges. Above this the full output is saved as an artifact and a bounded head+tail snippet is kept inline. Live layofflabs/gpt-5.5 medium evidence on 2026-07-07 found no token savings and a lower cache-hit rate at 50 KB, so normal coding sessions should leave this Off unless intentionally measuring large-read behavior.",
|
|
559
|
+
options: [
|
|
560
|
+
{ value: "0", label: "Off", description: "Default; no read-specific spill (backstop only)" },
|
|
561
|
+
{ value: "50", label: "50 KB", description: "~12.5K tokens" },
|
|
562
|
+
{ value: "100", label: "100 KB", description: "~25K tokens" },
|
|
563
|
+
{ value: "256", label: "256 KB", description: "~64K tokens" },
|
|
564
|
+
{ value: "512", label: "512 KB", description: "~128K tokens" },
|
|
565
|
+
{ value: "1000", label: "1 MB", description: "~250K tokens" },
|
|
566
|
+
],
|
|
567
|
+
},
|
|
568
|
+
},
|
|
569
|
+
|
|
570
|
+
"tools.fileMentionInlineBytes": {
|
|
571
|
+
type: "number",
|
|
572
|
+
default: 20,
|
|
573
|
+
ui: {
|
|
574
|
+
tab: "tools",
|
|
575
|
+
label: "File-mention inline cap (KB)",
|
|
576
|
+
description:
|
|
577
|
+
"Inline byte cap for auto-read `@path` file mentions, deliberately below the read-tool cap so an incidental mention injects a smaller snippet than an explicit read. The full file is still available via the read tool.",
|
|
578
|
+
options: [
|
|
579
|
+
{ value: "5", label: "5 KB", description: "~1.25K tokens" },
|
|
580
|
+
{ value: "10", label: "10 KB", description: "~2.5K tokens" },
|
|
581
|
+
{ value: "20", label: "20 KB", description: "Default; ~5K tokens" },
|
|
582
|
+
{ value: "50", label: "50 KB", description: "~12.5K tokens (matches read cap)" },
|
|
583
|
+
],
|
|
584
|
+
},
|
|
585
|
+
},
|
|
548
586
|
"tools.artifactTailBytes": {
|
|
549
587
|
type: "number",
|
|
550
588
|
default: 20,
|
|
@@ -623,6 +661,25 @@ export const SETTINGS_SCHEMA = {
|
|
|
623
661
|
},
|
|
624
662
|
},
|
|
625
663
|
|
|
664
|
+
"tools.maxInlineResultBytes": {
|
|
665
|
+
type: "number",
|
|
666
|
+
default: 0,
|
|
667
|
+
ui: {
|
|
668
|
+
tab: "tools",
|
|
669
|
+
label: "Max inline tool-result size (KB)",
|
|
670
|
+
description:
|
|
671
|
+
"Absolute backstop cap on inline tool-result text, enforced after artifact spill for every tool (including read and tools that set their own partial artifact meta). Output above this size is force-saved as an artifact and truncated to head+tail. 0 disables (default; opt-in pending measurement).",
|
|
672
|
+
options: [
|
|
673
|
+
{ value: "0", label: "Off", description: "Disabled; no absolute inline cap" },
|
|
674
|
+
{ value: "20", label: "20 KB", description: "~5K tokens" },
|
|
675
|
+
{ value: "30", label: "30 KB", description: "~7.5K tokens" },
|
|
676
|
+
{ value: "50", label: "50 KB", description: "~12.5K tokens" },
|
|
677
|
+
{ value: "75", label: "75 KB", description: "~19K tokens" },
|
|
678
|
+
{ value: "100", label: "100 KB", description: "~25K tokens" },
|
|
679
|
+
],
|
|
680
|
+
},
|
|
681
|
+
},
|
|
682
|
+
|
|
626
683
|
"statusLine.showHookStatus": {
|
|
627
684
|
type: "boolean",
|
|
628
685
|
default: false,
|
|
@@ -1385,6 +1442,15 @@ export const SETTINGS_SCHEMA = {
|
|
|
1385
1442
|
|
|
1386
1443
|
"compaction.remoteEndpoint": { type: "string", default: undefined },
|
|
1387
1444
|
|
|
1445
|
+
// Below-threshold maintenance pruning (Finding 13). Internal/measurement-only:
|
|
1446
|
+
// keep the runtime setting for targeted experiments, but do not expose it in
|
|
1447
|
+
// settings UI. Live layofflabs/gpt-5.5 medium evidence on 2026-07-07 showed no
|
|
1448
|
+
// savings and a cache-hit regression; pruning rewrites already-sent history and
|
|
1449
|
+
// can force a provider cache-epoch reset.
|
|
1450
|
+
"compaction.maintenancePruningEnabled": { type: "boolean", default: false },
|
|
1451
|
+
|
|
1452
|
+
"compaction.maintenancePruningMinSavingsTokens": { type: "number", default: 8000 },
|
|
1453
|
+
|
|
1388
1454
|
// Idle compaction
|
|
1389
1455
|
"compaction.idleEnabled": {
|
|
1390
1456
|
type: "boolean",
|
|
@@ -1658,7 +1724,8 @@ export const SETTINGS_SCHEMA = {
|
|
|
1658
1724
|
ui: {
|
|
1659
1725
|
tab: "context",
|
|
1660
1726
|
label: "TTSR Context Mode",
|
|
1661
|
-
description:
|
|
1727
|
+
description:
|
|
1728
|
+
"What to do with partial output when TTSR triggers. 'discard' (recommended) drops the aborted partial turn so it never accumulates in context. 'keep' retains every aborted partial turn, which grows the token footprint each time a rule fires — prefer 'discard' unless you specifically need the partial output.",
|
|
1662
1729
|
},
|
|
1663
1730
|
},
|
|
1664
1731
|
|
|
@@ -3219,6 +3286,8 @@ export interface CompactionSettings {
|
|
|
3219
3286
|
autoContinue: boolean;
|
|
3220
3287
|
remoteEnabled: boolean;
|
|
3221
3288
|
remoteEndpoint: string | undefined;
|
|
3289
|
+
maintenancePruningEnabled: boolean;
|
|
3290
|
+
maintenancePruningMinSavingsTokens: number;
|
|
3222
3291
|
idleEnabled: boolean;
|
|
3223
3292
|
idleThresholdTokens: number;
|
|
3224
3293
|
idleTimeoutSeconds: number;
|
|
@@ -3341,6 +3410,12 @@ export interface NotificationsSettings {
|
|
|
3341
3410
|
telegram: {
|
|
3342
3411
|
botToken: string | undefined;
|
|
3343
3412
|
chatId: string | undefined;
|
|
3413
|
+
rich: {
|
|
3414
|
+
enabled: boolean;
|
|
3415
|
+
};
|
|
3416
|
+
richDraft: {
|
|
3417
|
+
enabled: boolean;
|
|
3418
|
+
};
|
|
3344
3419
|
};
|
|
3345
3420
|
discord: {
|
|
3346
3421
|
botToken: string | undefined;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: deep-interview
|
|
3
3
|
description: Socratic deep interview with mathematical ambiguity gating before explicit execution approval
|
|
4
4
|
argument-hint: "[--trace] [--quick|--standard|--deep] <idea or vague description>"
|
|
5
|
-
pipeline: [deep-interview,
|
|
5
|
+
pipeline: [deep-interview, ralplan]
|
|
6
6
|
handoff-policy: approval-required
|
|
7
7
|
handoff: .gjc/_session-{sessionid}/specs/deep-interview-{slug}.md
|
|
8
8
|
level: 3
|
|
@@ -97,14 +97,14 @@ Complete this phase before Phase 1, before brownfield exploration, before GJC st
|
|
|
97
97
|
1. **Prefer pre-resolved native state**:
|
|
98
98
|
- First inspect active deep-interview state with `gjc state deep-interview read --json`.
|
|
99
99
|
- If state contains a finite numeric `threshold` and a non-empty `threshold_source`, use those values, set `<resolvedThreshold>`, `<resolvedThresholdPercent>`, and `<resolvedThresholdSource>`, and skip optional settings-file reads. This is the normal `/skill:deep-interview` path because the native hook already resolved settings quietly before loading the skill.
|
|
100
|
-
2. **Only if native state lacks a resolved threshold, read threshold settings in precedence order**:
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
- Read `gjc.deepInterview.ambiguityThreshold` only from files that are known to exist; optional settings-file absence is expected and must not be surfaced as failed `Read` calls.
|
|
100
|
+
2. **Only if native state lacks a resolved threshold, read threshold settings in runtime precedence order**:
|
|
101
|
+
- YAML config first: read the **single** modern config path the environment selects — `$GJC_CODING_AGENT_DIR/config.yml` when `GJC_CODING_AGENT_DIR` is set, else `$GJC_CONFIG_DIR/agent/config.yml` when `GJC_CONFIG_DIR` is set, else `~/.gjc/agent/config.yml`. Do not cascade through the other YAML locations when the selected one is absent or invalid.
|
|
102
|
+
- Then JSON settings: project settings `./.gjc/settings.json`, then user settings `[$GJC_CONFIG_DIR|~/.gjc]/settings.json`.
|
|
103
|
+
- Read `gjc.deepInterview.ambiguityThreshold` only from files that are known to exist; optional config/settings-file absence is expected and must not be surfaced as failed `Read` calls.
|
|
104
104
|
- Do not probe arbitrary ancestor candidates such as `../../.gjc/settings.json`; use the current project `.gjc/settings.json` and user settings only.
|
|
105
105
|
3. **Resolve threshold and source**:
|
|
106
|
-
- Use the
|
|
107
|
-
- Set these run variables exactly: `<resolvedThreshold>`, `<resolvedThresholdPercent>`, and `<resolvedThresholdSource>` (for example `./.gjc/settings.json`, `[$GJC_CONFIG_DIR|~/.gjc]/settings.json`, or
|
|
106
|
+
- Use the first valid configured value in the precedence order above; otherwise use the mode default when a resolution flag was passed: `--quick` = `0.6`, `--standard` = `0.5`, `--deep` = `0.35`; with no resolution flag, use the base default `0.05`.
|
|
107
|
+
- Set these run variables exactly: `<resolvedThreshold>`, `<resolvedThresholdPercent>`, and `<resolvedThresholdSource>` (for example `GJC_CODING_AGENT_DIR/config.yml`, `$GJC_CONFIG_DIR/agent/config.yml`, `~/.gjc/agent/config.yml`, `./.gjc/settings.json`, `[$GJC_CONFIG_DIR|~/.gjc]/settings.json`, or the selected mode default).
|
|
108
108
|
4. **Emit the required first line to the user before any other interview announcement**:
|
|
109
109
|
|
|
110
110
|
```
|
|
@@ -121,7 +121,7 @@ Deep Interview threshold: <resolvedThresholdPercent> (source: <resolvedThreshold
|
|
|
121
121
|
|
|
122
122
|
Run this gate after the Phase 0 threshold marker and before Phase 1, brownfield exploration, `gjc state write`, Round 0, ambiguity scoring, or spec writing.
|
|
123
123
|
|
|
124
|
-
If `
|
|
124
|
+
If the user request appended after this skill as the final `User:` line is already clear, bounded, low-risk, and asks for a quick fix, single change, known file/symbol edit, explicit command, or direct answer:
|
|
125
125
|
|
|
126
126
|
1. **Stop deep-interview immediately**:
|
|
127
127
|
- First inspect current-session state with `gjc state read --mode deep-interview --json` (include `--session-id <current-session-id>` when available).
|
|
@@ -150,7 +150,7 @@ Run this phase only when the active deep-interview state or invocation indicates
|
|
|
150
150
|
|
|
151
151
|
## Phase 1: Initialize
|
|
152
152
|
|
|
153
|
-
1. **Parse the user's idea** from `
|
|
153
|
+
1. **Parse the user's idea** from the user request appended after this skill as the final `User:` line
|
|
154
154
|
2. **Detect brownfield vs greenfield**:
|
|
155
155
|
- Use focused read/search tools or a canonical read-only role agent (`planner`/`architect`) to check if cwd has existing source code, package files, or git history
|
|
156
156
|
- If source files exist AND the user's idea references modifying/extending something: **brownfield**
|
|
@@ -167,7 +167,7 @@ Run this phase only when the active deep-interview state or invocation indicates
|
|
|
167
167
|
- Inspect the initial idea plus any pasted artifacts, logs, transcripts, or file excerpts for prompt-budget risk before writing state or generating the first question.
|
|
168
168
|
- If the initial context is oversized or likely to crowd out downstream prompts, produce a concise prompt-safe summary that preserves user intent, decisions, constraints, unknowns, cited files/symbols, and any explicit non-goals.
|
|
169
169
|
- Treat the summary as the canonical `initial_idea` and store the raw oversized material only as external/advisory context if it can be referenced safely; do not paste the raw oversized context into question-generation, ambiguity-scoring, spec-crystallization, or execution-handoff prompts.
|
|
170
|
-
- Wait until the summary exists before ambiguity scoring, weakest-dimension selection, brownfield exploration prompts, or any bridge to `ralplan`, `
|
|
170
|
+
- Wait until the summary exists before ambiguity scoring, weakest-dimension selection, brownfield exploration prompts, or any bridge to `ralplan`, `ultragoal`, or `team`.
|
|
171
171
|
3.7. **Artifact path discipline**:
|
|
172
172
|
- Final specs MUST resolve to `.gjc/_session-{sessionid}/specs/deep-interview-{slug}.md` exactly.
|
|
173
173
|
- Write final specs and all ephemeral interview artifacts through the active GJC workflow/state CLI when available.
|
|
@@ -311,7 +311,7 @@ Build the question generation prompt with:
|
|
|
311
311
|
|
|
312
312
|
- `language` from active state when present; apply `language.instruction` to all natural-language user-facing question text, rationale, and options
|
|
313
313
|
|
|
314
|
-
If any prompt input is too large, summarize it first and then continue from the summary. Do not ask the next
|
|
314
|
+
If any prompt input is too large, summarize it first and then continue from the summary. Do not ask the next question, score ambiguity, or hand off to execution from an over-budget raw transcript.
|
|
315
315
|
|
|
316
316
|
**Question targeting strategy:**
|
|
317
317
|
- Identify the active component + dimension pair with the LOWEST clarity score across the locked topology
|
|
@@ -683,7 +683,6 @@ Spec structure:
|
|
|
683
683
|
|
|
684
684
|
## Phase 5: Execution Bridge
|
|
685
685
|
|
|
686
|
-
**Research workflow override:** if `--research-setup` is active, skip the standard execution options below and write a pending-approval spec that names research setup as an unresolved follow-up. Do not invoke deprecated research workflow shims.
|
|
687
686
|
|
|
688
687
|
After the spec is written, mark it `pending approval` and present execution options via the `ask` tool. Until the user selects an execution option, the deep-interview module MUST NOT run mutation-oriented shell commands, edit source files, commit, push, open PRs, invoke execution skills, or delegate implementation tasks:
|
|
689
688
|
|
|
@@ -948,4 +947,4 @@ See Phase 3 for the full persona set (researcher/contrarian/simplifier, plus arc
|
|
|
948
947
|
| Extreme ambiguity | Almost nothing known | Early stages, keep going |
|
|
949
948
|
</Advanced>
|
|
950
949
|
|
|
951
|
-
Task:
|
|
950
|
+
Task: Use the user request appended after this skill as the final `User:` line.
|
|
@@ -19,11 +19,10 @@ Ralplan is the consensus planning workflow. It triggers iterative planning with
|
|
|
19
19
|
|
|
20
20
|
## Flags
|
|
21
21
|
|
|
22
|
-
- `--interactive`:
|
|
23
|
-
- `--deliberate`: Forces
|
|
24
|
-
- `--architect openai-code`: Use OpenAI code for
|
|
25
|
-
- `--
|
|
26
|
-
- `--write --stage <type> --stage_n <N> --artifact <markdown file path or markdown string>`: Native artifact write path persisting Planner, Architect, Critic, revision, ADR, and final pending-approval plan markdown under `.gjc/_session-{sessionid}/plans/ralplan/<run-id>/`. Use this instead of editing `.gjc/` files directly.
|
|
22
|
+
- `--interactive`: Adds draft-review prompts and one-at-a-time reconciliation; final approval always uses an `ask` workflow gate and never auto-executes.
|
|
23
|
+
- `--deliberate`: Forces high-risk deliberation: pre-mortem plus expanded test planning. It may also auto-enable for explicit auth/security, migration, destructive, incident, compliance/PII, or public-API-breakage risk.
|
|
24
|
+
- `--architect openai-code` / `--critic openai-code`: Use OpenAI code for that review pass when available; otherwise note the fallback and use default GJC review.
|
|
25
|
+
- `--write --stage <type> --stage_n <N> --artifact <markdown file path or markdown string>`: Native writer for Planner/Architect/Critic/revision/ADR/final pending-approval markdown under `.gjc/_session-{sessionid}/plans/ralplan/<run-id>/`; do not edit `.gjc/` directly.
|
|
27
26
|
|
|
28
27
|
## Usage with interactive mode
|
|
29
28
|
|
|
@@ -33,15 +32,16 @@ Ralplan is the consensus planning workflow. It triggers iterative planning with
|
|
|
33
32
|
|
|
34
33
|
## Corrupt current-session state recovery
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
For corrupt, tampered, unreadable, or stale current-session ralplan state, run `gjc state clear --force --mode ralplan` scoped by `--session-id`, command payload, or `GJC_SESSION_ID`; it clears only ralplan state for that session.
|
|
37
36
|
|
|
38
37
|
## Behavior
|
|
39
38
|
|
|
40
39
|
## Planning/Execution Boundary
|
|
41
40
|
|
|
42
|
-
Ralplan is
|
|
41
|
+
Ralplan is planning only. It may inspect context and draft plan/spec/proposal artifacts, but those remain `pending approval` until explicit current-turn or structured-UI execution approval. Before that approval, do not mutate product source, run mutation-oriented shell, commit, push, open PRs, invoke execution skills, or delegate implementation.
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
Persist planning artifacts and handoffs through the ralplan CLI writer, never direct `.gjc/` edits:
|
|
44
|
+
Direct `write`, `edit`, or `ast_edit` calls against `.gjc/_session-{sessionid}/specs`, `.gjc/_session-{sessionid}/plans`, `.gjc/_session-{sessionid}/state`, or any other `.gjc/` path are forbidden unless an explicit force override is active.
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
47
|
gjc ralplan --write --stage <type> --stage_n <N> --artifact "markdown file path or markdown string"
|
|
@@ -49,13 +49,9 @@ gjc ralplan --write --stage <type> --stage_n <N> --artifact "markdown file path
|
|
|
49
49
|
gjc ralplan --write --stage <type> --stage_n <N> --artifact-env GJC_RALPLAN_ARTIFACT
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
Use
|
|
52
|
+
Use stages `planner`, `architect`, `critic`, `revision`, `post-interview`, `adr`, or `final`; increment `--stage_n` each consensus pass. The writer accepts inline markdown, an artifact path prepared outside `.gjc/`, or `--artifact-env GJC_RALPLAN_ARTIFACT`, persists `stage-<NN>-<stage>.md` plus `index.jsonl` under `.gjc/_session-{sessionid}/plans/ralplan/<run-id>/`, and copies `final` to `pending-approval.md`. Ralplan mutation blocking is enforced in code; use temp directories (`os.tmpdir()`/`$TMPDIR`, `/tmp`, `/var/tmp`) only for oversized scratch artifacts, never the repo or `.gjc/`.
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Restricted read-only role agents (`planner`, `architect`, and `critic`) must pass markdown content through the `GJC_RALPLAN_ARTIFACT` env override with `--artifact-env GJC_RALPLAN_ARTIFACT`; their restricted bash environment intentionally disables artifact file-path ingestion so a verdict command cannot persist arbitrary file contents.
|
|
57
|
-
|
|
58
|
-
After a role agent persists a stage artifact, its model-facing response to the caller SHOULD be receipt-only: return the `gjc ralplan --write --json` receipt (`run_id`, `path`, `stage`, `stage_n`, `sha256`, `created_at`) plus the minimal verdict/status fields the caller needs for routing, and do **not** paste the full persisted markdown back into the parent conversation. Downstream reviewers should receive the artifact path/receipt and read the persisted file themselves when they actually need the body. This preserves the audit trail while preventing Planner/Architect/Critic verdict bodies from being duplicated into the main-agent context.
|
|
54
|
+
Restricted read-only role agents (`planner`, `architect`, `critic`) must pass markdown through `GJC_RALPLAN_ARTIFACT` with `--artifact-env GJC_RALPLAN_ARTIFACT`; their restricted bash environment disables artifact file-path ingestion.
|
|
59
55
|
|
|
60
56
|
RECEIPT-ONLY guideline: role agents (`planner`, `architect`, and `critic`) persist durable outputs via `gjc ralplan --write` and return ONLY the receipt fields (`run_id`, `path`, `sha256`) plus verdict/status routing fields; include `stage` and `stage_n` when available, and never return the full persisted body.
|
|
61
57
|
|
|
@@ -70,12 +66,10 @@ The consensus workflow:
|
|
|
70
66
|
- If only one viable option remains, explicit invalidation rationale for alternatives
|
|
71
67
|
- Deliberate mode only: pre-mortem (3 scenarios) + expanded test plan (unit/integration/e2e/observability)
|
|
72
68
|
2. **User feedback** *(--interactive only)*: If `--interactive` is set, use the `ask` tool to present the draft plan **plus the Principles / Drivers / Options summary** before review (Proceed to review / Request changes / Skip review). Otherwise, automatically proceed to review.
|
|
73
|
-
3. **Review fan-out after Planner persistence**:
|
|
74
|
-
- **Architect lane**:
|
|
75
|
-
-
|
|
76
|
-
- **
|
|
77
|
-
- The Critic agent/subagent must persist its evaluation with `gjc ralplan --write --stage critic --stage_n <N> --artifact-env GJC_RALPLAN_ARTIFACT --json`, then return the receipt/path plus compact verdict/status (`OKAY`/`ITERATE`/`REJECT`) instead of pasting the full evaluation body.
|
|
78
|
-
- **Sequential fallback**: when Critic must evaluate Architect findings, verdict, antithesis, tradeoffs, synthesis, architectural status, or any other Architect-produced artifact, await the Architect result before issuing that Architect-dependent Critic pass.
|
|
69
|
+
3. **Review fan-out after Planner persistence**: launch fresh Architect and Critic review lanes against the same immutable Planner receipt/path/sha/stage_n when Critic is **plan-only** and does not consume Architect output.
|
|
70
|
+
- **Architect lane**: challenge architecture, surface tradeoff tensions, and enrich thin plans with synthesis or missed sub-scope. Persist with `gjc ralplan --write --stage architect --stage_n <N> --artifact-env GJC_RALPLAN_ARTIFACT --json`, then return receipt/path plus `CLEAR`/`WATCH`/`BLOCK` and `APPROVE`/`COMMENT`/`REQUEST CHANGES`.
|
|
71
|
+
- **Plan-only Critic lane**: independently check quality, principle-option consistency, alternatives, risks, acceptance criteria, and verification; when the plan is thin, request concrete expansion rather than only defects. Persist with `gjc ralplan --write --stage critic --stage_n <N> --artifact-env GJC_RALPLAN_ARTIFACT --json`, then return receipt/path plus `OKAY`/`ITERATE`/`REJECT`.
|
|
72
|
+
- **Sequential fallback**: if Critic must evaluate Architect findings, verdict, antithesis, tradeoffs, synthesis, status, or any Architect-produced artifact, await the Architect result before issuing that Architect-dependent Critic pass.
|
|
79
73
|
4. **Review join gate**: before consensus, revision, reconciliation, finalization, or approval, verify both Architect and Critic receipts/verdicts exist for the same Planner artifact/pass (`path`, `sha256`, `stage_n`). A non-`CLEAR` Architect verdict, non-`APPROVE` Architect decision, or any non-`OKAY` Critic verdict routes back to Planner revision; do not finalize from only one review lane.
|
|
80
74
|
5. **Re-review loop** (max 5 iterations): Any non-`OKAY` Critic verdict (`ITERATE` or `REJECT`) or Architect result that is not `CLEAR`/`APPROVE` MUST run the same full closed loop:
|
|
81
75
|
a. Collect Architect + Critic feedback
|
|
@@ -114,13 +108,13 @@ The consensus workflow:
|
|
|
114
108
|
> **Important:** Architect and Critic MAY run in the same parallel batch only for the plan-only Critic lane after Planner persistence. Any Architect-dependent Critic pass MUST remain sequential: await Architect before issuing Critic, then apply the same review join gate before consensus.
|
|
115
109
|
|
|
116
110
|
|
|
117
|
-
Follow
|
|
111
|
+
Follow this ralplan-internal consensus workflow for consensus mode details.
|
|
118
112
|
|
|
119
113
|
### Persisted Planner (consensus loop)
|
|
120
114
|
|
|
121
|
-
The Planner is a **same-session persisted subagent**: launched detached once, awaited before review fan-out, then **resumed** with consolidated Architect + Critic
|
|
115
|
+
The Planner is a **same-session persisted subagent**: launched detached once, awaited before review fan-out, then **resumed** with consolidated Architect + Critic challenge and enrichment on each re-review pass. Architect and Critic are fresh independent spawns each pass; Critic may run in parallel only when plan-only and tied to the same Planner receipt/path/sha/stage_n. Do NOT modify the subagent control surface; use existing `subagent` resume/steer controls only.
|
|
122
116
|
|
|
123
|
-
**Persistence boundary:**
|
|
117
|
+
**Persistence boundary:** same-parent, active-session continuity only. Resumability requires retained subagent resume metadata and a persistent parent session (in-memory parent yields `resumable:false`), not just `.gjc` run-state. A terminal subagent can still resume when its retained descriptor points at a saved subagent session; after process restart, missing metadata, or failed/unavailable resume, use fresh Planner fallback.
|
|
124
118
|
|
|
125
119
|
**Resume routing table** (per re-review pass, when resuming the persisted Planner id):
|
|
126
120
|
|
|
@@ -145,73 +139,16 @@ Set `--planner-resumable true` only when the parent session is provably persiste
|
|
|
145
139
|
|
|
146
140
|
## Pre-Execution Gate
|
|
147
141
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
- `team fix the null check in src/hooks/bridge.ts:326`
|
|
162
|
-
- `team implement issue #42`
|
|
163
|
-
- `team add validation to function processKeywordDetector`
|
|
164
|
-
- `team do:\n1. Add input validation\n2. Write tests\n3. Update README`
|
|
165
|
-
- `team add the user model in src/models/user.ts`
|
|
166
|
-
|
|
167
|
-
**Gated — redirected to ralplan** (needs scoping first):
|
|
168
|
-
- `team fix this`
|
|
169
|
-
- `team build the app`
|
|
170
|
-
- `team improve performance`
|
|
171
|
-
- `team add authentication`
|
|
172
|
-
- `team make it better`
|
|
173
|
-
|
|
174
|
-
**Bypass the gate** (when you know what you want):
|
|
175
|
-
- `force: team refactor the auth module`
|
|
176
|
-
- `! team optimize everything`
|
|
177
|
-
|
|
178
|
-
### When the Gate Does NOT Trigger
|
|
179
|
-
|
|
180
|
-
The gate auto-passes when it detects **any** concrete signal. You do not need all of them — one is enough:
|
|
181
|
-
|
|
182
|
-
| Signal Type | Example prompt | Why it passes |
|
|
183
|
-
|---|---|---|
|
|
184
|
-
| File path | `team fix src/hooks/bridge.ts` | References a specific file |
|
|
185
|
-
| Issue/PR number | `team implement #42` | Has a concrete work item |
|
|
186
|
-
| camelCase symbol | `team fix processKeywordDetector` | Names a specific function |
|
|
187
|
-
| PascalCase symbol | `team update UserModel` | Names a specific class |
|
|
188
|
-
| snake_case symbol | `team fix user_model` | Names a specific identifier |
|
|
189
|
-
| Test runner | `team npm test && fix failures` | Has an explicit test target |
|
|
190
|
-
| Numbered steps | `team do:\n1. Add X\n2. Test Y` | Structured deliverables |
|
|
191
|
-
| Acceptance criteria | `team add login - acceptance criteria: ...` | Explicit success definition |
|
|
192
|
-
| Error reference | `team fix TypeError in auth` | Specific error to address |
|
|
193
|
-
| Code block | `team add: \`\`\`ts ... \`\`\`` | Concrete code provided |
|
|
194
|
-
| Escape prefix | `force: team do it` or `! team do it` | Explicit user override |
|
|
195
|
-
|
|
196
|
-
### End-to-End Flow Example
|
|
197
|
-
|
|
198
|
-
1. User types: `team add user authentication`
|
|
199
|
-
2. Gate detects: execution keyword (`team`) + underspecified prompt (no files, functions, or test spec)
|
|
200
|
-
3. Gate redirects to **ralplan** with message explaining the redirect
|
|
201
|
-
4. Ralplan consensus runs:
|
|
202
|
-
- **Planner** creates initial plan (which files, what auth method, what tests)
|
|
203
|
-
- **Architect** reviews for soundness
|
|
204
|
-
- **Critic** validates quality and testability
|
|
205
|
-
5. On consensus approval, user chooses execution path:
|
|
206
|
-
- **ultragoal**: goal-tracked autonomous execution with verification (recommended default)
|
|
207
|
-
- **team**: N coordinated parallel agents in tmux — only when tmux-based interactive worker parallelization is required
|
|
208
|
-
6. Execution begins with a clear, bounded plan
|
|
209
|
-
|
|
210
|
-
### Troubleshooting
|
|
211
|
-
|
|
212
|
-
| Issue | Solution |
|
|
213
|
-
|-------|----------|
|
|
214
|
-
| Gate fires on a well-specified prompt | Add a file reference, function name, or issue number to anchor the request |
|
|
215
|
-
| Want to bypass the gate | Prefix with `force:` or `!` (e.g., `force: team fix it`) |
|
|
216
|
-
| Gate does not fire on a vague prompt | The gate only catches prompts with <=15 effective words and no concrete anchors; add more detail or use `/skill:ralplan` explicitly |
|
|
217
|
-
| Redirected to ralplan but want execution | Use the structured approval option or explicitly say which execution skill should proceed; `just do it` / `skip planning` alone only ends planning with a `pending approval` artifact |
|
|
142
|
+
Execution skills (`ultragoal`, `team`) implement bounded work; they are not scope-discovery lanes. Vague execution requests such as `team improve the app` are routed through ralplan so scope, acceptance criteria, consensus, and verification exist before code changes.
|
|
143
|
+
|
|
144
|
+
**Passes the gate** (specific enough for direct execution): file paths, issue/PR numbers, named symbols, explicit tests, numbered steps, acceptance criteria, error references, code blocks, or escape prefixes (`force:` / `!`). Examples: `team fix src/hooks/bridge.ts`, `team implement #42`, `team add validation to processKeywordDetector`, `team do:\n1. Add input validation\n2. Write tests`.
|
|
145
|
+
|
|
146
|
+
**Gated — redirected to ralplan**: `team fix this`, `team build the app`, `team improve performance`, `team add authentication`, `team make it better`.
|
|
147
|
+
|
|
148
|
+
Gate auto-pass signals: file path, issue/PR number, camelCase/PascalCase/snake_case symbol, test runner, numbered steps, acceptance criteria, error reference, code block, or escape prefix. If it fires on a well-specified prompt, add one concrete anchor; if you intentionally bypass, prefix `force:` or `!`.
|
|
149
|
+
|
|
150
|
+
On consensus approval, choose:
|
|
151
|
+
- **ultragoal**: goal-tracked autonomous execution with verification (recommended default)
|
|
152
|
+
- **team**: tmux-based coordinated workers only when interactive worker parallelization is required
|
|
153
|
+
|
|
154
|
+
A redirected request proceeds only through the structured approval option or an explicit execution-skill choice; `just do it` / `skip planning` alone leaves the plan `pending approval`.
|
|
@@ -343,14 +343,15 @@ Use only after checking `gjc team status <team>` and state evidence:
|
|
|
343
343
|
- `.gjc/_session-{sessionid}/state/team/<team>/config.json`
|
|
344
344
|
- `.gjc/_session-{sessionid}/state/team/<team>/tasks/task-1.json`
|
|
345
345
|
- `.gjc/_session-{sessionid}/state/team/<team>/mailbox/worker-1.json`
|
|
346
|
-
2.
|
|
347
|
-
- `
|
|
348
|
-
-
|
|
349
|
-
|
|
350
|
-
|
|
346
|
+
2. Use supported team surfaces before manual pane intervention:
|
|
347
|
+
- `gjc team status <team>` for current recorded state
|
|
348
|
+
- `gjc team monitor <team>` when a live monitor/update loop is needed
|
|
349
|
+
- `gjc team api <team>` only for documented programmatic operations
|
|
350
|
+
3. If the recorded worker pane is stuck in an interactive state, safely return to idle prompt first:
|
|
351
|
+
- optional interrupt `C-c` or escape flow (CLI-specific) once, then re-check `gjc team status <team>` and relevant state files
|
|
351
352
|
4. Send one concise trigger only when runtime/state checks show manual prompt input is needed:
|
|
352
353
|
- `tmux send-keys -t %<worker-pane> "continue current task; report status" C-m`
|
|
353
|
-
5. Re-check
|
|
354
|
+
5. Re-check task state, worker mailbox, and `gjc team status <team>`.
|
|
354
355
|
|
|
355
356
|
### Shutdown reports success but stale worker panes remain
|
|
356
357
|
|
|
@@ -372,8 +373,9 @@ tmux list-panes -F '#{pane_id} #{pane_current_command} #{pane_start_command}'
|
|
|
372
373
|
tmux kill-pane -t %450
|
|
373
374
|
tmux kill-pane -t %451
|
|
374
375
|
|
|
375
|
-
# 3)
|
|
376
|
-
#
|
|
376
|
+
# 3) Shut down recorded team state/workers through the supported team runtime
|
|
377
|
+
# Replace <team-name> with the team from `gjc team list` / `gjc team status`.
|
|
378
|
+
gjc team shutdown <team-name>
|
|
377
379
|
|
|
378
380
|
# 4) Retry
|
|
379
381
|
gjc team executor "fresh retry"
|
|
@@ -396,7 +398,7 @@ When operating this skill, provide concrete progress evidence:
|
|
|
396
398
|
|
|
397
399
|
Do not claim success without file/pane evidence.
|
|
398
400
|
Do not claim clean completion if shutdown occurred with `in_progress>0`.
|
|
399
|
-
Use `gjc
|
|
401
|
+
Use `gjc team status <team>` and `gjc team monitor <team>` as the supported operator aids for status inspection; keep raw state-file or pane evidence available for manual intervention and proof.
|
|
400
402
|
|
|
401
403
|
## Programmatic Team Orchestration
|
|
402
404
|
|
|
@@ -405,14 +407,15 @@ Use the `gjc team ...` CLI as the supported team-launch surface. For automation,
|
|
|
405
407
|
### Supported current surfaces
|
|
406
408
|
|
|
407
409
|
- **`gjc team ...` CLI** — Primary method for interactive or automated team orchestration. Use this when you want direct tmux-pane visibility or a scriptable launch path.
|
|
410
|
+
- **`gjc team status <team>`** — Read current team/task/worker state.
|
|
411
|
+
- **`gjc team monitor <team>`** — Follow live progress through the supported runtime surface.
|
|
412
|
+
- **`gjc team shutdown <team>`** — Stop recorded active workers and move the team toward terminal state.
|
|
413
|
+
- **`gjc team api <team>`** — Use only for documented programmatic operations exposed by the team runtime.
|
|
408
414
|
- **Team state files** — Inspect `.gjc/_session-{sessionid}/state/team/<team>/` when you need status, task, or mailbox evidence after launch.
|
|
409
415
|
|
|
410
416
|
### Cleanup distinction
|
|
411
417
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
- `team_cleanup` (**state-server**): Deletes team state **files** on disk (`.gjc/_session-{sessionid}/state/team/<team>/`). Use after a team run is fully complete.
|
|
415
|
-
- tmux/session cleanup: Use the documented `gjc team` shutdown / cleanup flow when you need to stop the worker pane or clean up an interrupted run.
|
|
418
|
+
Use `gjc team shutdown <team>` for recorded active workers. After shutdown reports a terminal state and required evidence is preserved, use supported `gjc state ...` session/mode cleanup commands only when you are intentionally clearing state; do not delete team state by hand during an active run. Use manual tmux/session cleanup only for verified stale panes that are not handled by the documented shutdown flow.
|
|
416
419
|
|
|
417
420
|
### Automation example
|
|
418
421
|
|
|
@@ -87,6 +87,17 @@ Durable completion is single-source: `goals.json` defines which goals exist and
|
|
|
87
87
|
- `gjc ultragoal create-goals --gjc-goal-mode per-story --brief "<brief>"` only when one GJC goal context per story is explicitly preferred
|
|
88
88
|
3. Inspect `.gjc/_session-{sessionid}/ultragoal/goals.json` and refine if needed.
|
|
89
89
|
|
|
90
|
+
### Create-goals granularity: merge validation-coupled stories
|
|
91
|
+
|
|
92
|
+
Before splitting a brief into many thin stories, check whether the candidate stories are **validation-coupled**. Merge validation-coupled stories into one goal and fan out executor slices inside that goal instead of creating one goal per slice. Two stories are validation-coupled when they share any of:
|
|
93
|
+
|
|
94
|
+
- the same feature stack (one story's code cannot be meaningfully verified without the other's),
|
|
95
|
+
- the same acceptance surface,
|
|
96
|
+
- the same red-team surface, or
|
|
97
|
+
- the same final review boundary (they can only be signed off as a unit).
|
|
98
|
+
|
|
99
|
+
Fanning out executor slices inside a single merged goal keeps one review/QA boundary while preserving parallel implementation. When validation-coupled stories must stay as separate goals for scheduling reasons, use an aggregate-mode **validation batch** (below) so the coupled review happens once at the final member.
|
|
100
|
+
|
|
90
101
|
## Complete goals
|
|
91
102
|
|
|
92
103
|
Loop until `gjc ultragoal status` reports all goals complete:
|
|
@@ -192,6 +203,49 @@ If an Ultragoal request has no approved plan or consensus artifact, run `ralplan
|
|
|
192
203
|
|
|
193
204
|
The Ultragoal leader owns `.gjc/_session-{sessionid}/ultragoal/goals.json` and `.gjc/_session-{sessionid}/ultragoal/ledger.jsonl`. Role agents return implementation/review evidence; they do not checkpoint Ultragoal or mutate goal state.
|
|
194
205
|
|
|
206
|
+
### Native executor parallelism contract
|
|
207
|
+
|
|
208
|
+
Native subagent parallelism is a contract for bounded `executor` delegation, not a runtime scheduler and not a Team-mode rule:
|
|
209
|
+
|
|
210
|
+
- **MUST use native `executor` parallelism** when a story meets the big-scope delegation threshold above and decomposes into independent implementation slices that can be bounded by per-slice coordination contracts.
|
|
211
|
+
- **SHOULD prefer parallel `executor` subagents** for independent files/surfaces, and sequence only real dependencies, unsafe shared-file overlap, sub-threshold trivial work, or work that lacks a safe contract.
|
|
212
|
+
- Worker agents **MUST NOT mutate `.gjc/_session-{sessionid}/ultragoal`**, call goal tools, make checkpoint decisions, own integration, or own final verification. The Ultragoal leader keeps those responsibilities.
|
|
213
|
+
|
|
214
|
+
Before workers start, each per-slice coordination contract MUST name the target files/surfaces, independence assumptions, allowed coordination channel, conflict-escalation rule, expected evidence, and terminal status. Conflict or assignment changes remain leader-owned and must be auditable through durable ledger evidence.
|
|
215
|
+
|
|
216
|
+
For failed, timed-out, or contract-violating slices, record durable ledger evidence; preserve successful terminal slices only when safe; and reassign, retry, or collapse the invalid work to serial execution under an updated contract. Completion after parallel work still requires terminal worker evidence, leader integration, targeted verification, and the existing cleaner + architect + executor QA/red-team gate before checkpoint complete.
|
|
217
|
+
|
|
218
|
+
### Runtime-backed pipelined scheduling
|
|
219
|
+
|
|
220
|
+
Sequential execution remains the default. Ultragoal may use runtime-backed pipelined scheduling only when `goals.json` metadata proves original-plan independence and disjoint target files/surfaces for the prior and next goals. This is a leader-owned Ultragoal runtime contract, not hidden Team scheduling and not a substitute for the native executor parallelism contract above.
|
|
221
|
+
|
|
222
|
+
Pipeline metadata is explicit-only: create eligible goals with `gjc ultragoal create-goals --goal-metadata-json '<json>'` or the equivalent runtime `createUltragoalPlan({ goalMetadata })` input. Brief-only or missing metadata remains valid but non-eligible and falls back to ordinary sequential scheduling. The initial pipeline contract is **aggregate mode only**; per-story mode remains sequential until a separate UX/state contract exists.
|
|
223
|
+
|
|
224
|
+
The full lifecycle commands (`start-pipeline-overlap`, `join-pipeline-overlap`, `rebaseline-pipeline-overlap`) and the fail-closed overlap rules — at most one eligible next goal per join window, G(N) remains active until a clean join, quarantine and re-baseline on dirty joins or lost handles, complete checkpoints fail closed on open overlaps or unattributable change-set paths — are specified in the internal `pipeline-validation-contracts` fragment (`skill-fragments/ultragoal/pipeline-validation-contracts.md`). Load that fragment before operating an overlap; the runtime enforces its rules verbatim.
|
|
225
|
+
|
|
226
|
+
Team remains explicit and separate: Team is not auto-launched, not a hidden pipeline scheduler, and never owns Ultragoal goals, checkpoints, or ledger state.
|
|
227
|
+
|
|
228
|
+
## Validation batches (aggregate-only)
|
|
229
|
+
|
|
230
|
+
Validation batches let several aggregate-mode goals that share one review/QA boundary defer their heavyweight architect + executor QA/red-team review to a single **final member**, while each non-final member still proves targeted verification and cleanup. Validation batches are **aggregate-only**, **explicit-only**, and **fail-closed**. They are created only through `--validation-batch-json`; there is no inference from brief prose and no per-story batching.
|
|
231
|
+
|
|
232
|
+
Batches and #1701 pipeline metadata/overlap are **mutually exclusive**: `--validation-batch-json` and `--goal-metadata-json` cannot be combined, and a goal may not carry both `validationBatch` and eligible `pipelineMetadata`. There is no batch/pipeline mixing.
|
|
233
|
+
|
|
234
|
+
Create a batch explicitly:
|
|
235
|
+
|
|
236
|
+
```sh
|
|
237
|
+
gjc ultragoal create-goals --brief-file <path> --validation-batch-json '[{"schemaVersion":1,"batchId":"VB001","memberIds":["G001","G002","G003"],"finalGoalId":"G003"}]'
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Checkpoint contract summary — the full contract lives in the `pipeline-validation-contracts` fragment (`skill-fragments/ultragoal/pipeline-validation-contracts.md`); load it before checkpointing any batch member:
|
|
241
|
+
|
|
242
|
+
- **Non-final members** checkpoint `complete` with a single top-level `deferredToBatch` quality gate (kind `validation-batch-deferred`) proving targeted verification, an ai-slop-cleaner pass, a rerun iteration, and a cumulative-since-base change set — never `architectReview`, `executorQa`, or `validationBatchClose`; deferring never manufactures fake review approvals.
|
|
243
|
+
- **The final member** (`finalGoalId`) checkpoints `complete` with the normal full strict gate PLUS a top-level `validationBatchClose` proof covering all members; out-of-order close is rejected, close state is append-only proof on the final member only, and batch invalidation is fail-closed.
|
|
244
|
+
|
|
245
|
+
### Intra-goal validation-lane parallelism
|
|
246
|
+
|
|
247
|
+
Within a single goal (including a single-goal run or one validation-batch member), architect review and the executor QA/red-team lane MAY run in parallel, but only on the same **frozen post-cleaner change set**: run the ai-slop-cleaner to a zero-blocker pass and rerun verification first, then hand both lanes the identical frozen change-set summary. Parallel architect + executor QA/red-team lanes must **join before checkpoint** — neither lane may checkpoint independently. Fall back to **sequential** lanes when code is still changing, when the two lanes would see divergent snapshots, when the red-team lane depends on architect fixes, or when architect findings gate the QA scope.
|
|
248
|
+
|
|
195
249
|
## Use Ultragoal and Team together
|
|
196
250
|
|
|
197
251
|
Use ultragoal and team together for a durable Ultragoal story that benefits from one visible tmux worker session. Ultragoal remains leader-owned: `.gjc/_session-{sessionid}/ultragoal/goals.json` stores the story plan and `.gjc/_session-{sessionid}/ultragoal/ledger.jsonl` stores checkpoints. Team is the single-worker tmux execution engine and returns task/evidence status to the leader.
|
|
@@ -219,8 +273,8 @@ The completion-gate cleanup sweep is driven by `ai-slop-cleaner`, an internal Ul
|
|
|
219
273
|
An ultragoal story cannot be checkpointed `complete` until the active agent has run the quality gate. The gate is plan-first, contract-driven, and surface-based:
|
|
220
274
|
|
|
221
275
|
1. Run targeted implementation verification for the story.
|
|
222
|
-
2. Run the internal ai-slop-cleaner skill fragment as the
|
|
223
|
-
3. Rerun verification after the cleaner pass.
|
|
276
|
+
2. Run the internal ai-slop-cleaner skill fragment as the cleanup sweep on the story's changed files only, so only clean code reaches the review and red-team lanes. It is a read-only detector that emits an `AI SLOP CLEANUP REPORT`; if there are no relevant edits it still runs and records a passed/no-op report. Every BLOCKING cleaner finding is a completion blocker: the leader spawns an `executor` to fix blocking findings only, then reruns the cleaner until blocking findings are zero. Advisory findings are included in the gate report only and are not written to the Ultragoal ledger. Carry the report through the existing `qualityGate.iteration.evidence` field; do not add a new top-level quality-gate key.
|
|
277
|
+
3. Rerun verification after the cleaner pass so reviewed evidence covers the cleaned code.
|
|
224
278
|
4. Delegate an `architect` review covering all three lanes:
|
|
225
279
|
- architecture-side: system boundaries, layering, data/control flow, operational risks.
|
|
226
280
|
- product-side: user-visible behavior, acceptance criteria, edge cases, regressions.
|
|
@@ -228,7 +282,7 @@ An ultragoal story cannot be checkpointed `complete` until the active agent has
|
|
|
228
282
|
5. Delegate an `executor` QA/red-team lane to build and run the e2e/read-teaming QA suite appropriate for the story. This lane must try to break the change, not just confirm the happy path. It must start from the approved plan/spec/acceptance criteria, then user-facing contracts, and only then implementation code as supporting evidence. Plan/code mismatches are blockers, not items to paper over with implementation intent.
|
|
229
283
|
6. The executor QA/red-team lane must prove evidence by the real surface under test:
|
|
230
284
|
- GUI/web surfaces require a valid automation transcript plus a non-uniform screenshot. Bare `inlineEvidence` text or typed receipts never prove live GUI/web execution.
|
|
231
|
-
- CLI surfaces require runtime argv replay: `replaySafe: true`, an allowlisted argv `command`, and replayed
|
|
285
|
+
- CLI surfaces require runtime argv replay: `schemaVersion: 1`, `kind: "cli-replay"`, `replaySafe: true`, an allowlisted argv `command`, and replayed output validation. The complete field-by-field replay schema, command allowlist, and `replayExempt` audit contract are specified once in the "For CLI replay artifacts" paragraph below the quality-gate JSON; follow it exactly.
|
|
232
286
|
- Native/desktop/tui surfaces require a structurally valid screenshot, PTY capture with terminal control codes, or app-automation transcript.
|
|
233
287
|
- API/package surfaces require a real artifact file or typed receipt whose artifact `kind` contains one of `api`, `package`, `consumer`, `black-box`, or `test-report`; examples: `api-package-test-report`, `package-consumer-report`, `black-box-api-receipt`. Algorithm/math surfaces require a real artifact file or typed receipt whose artifact `kind` contains one of `property`, `boundary`, `edge`, `adversarial`, `failure`, `math`, `algorithm`, or `test-report`; examples: `property-test-report`, `algorithm-boundary-report`. Bare `inlineEvidence` text alone is not sufficient for any surface.
|
|
234
288
|
- The mandatory **computer-use** red-team suite (`kill-switch-bypass`, `suspended-enforcement`, `permission-revoked`, …) is conditional, not universal: require it only when computer/desktop control is genuinely part of the product surface being dogfooded. For every other product type, prove the change through the matching live surface instead — browser-use automation for web/GUI, bash/CLI live invocation or argv replay for CLI, and real artifacts or typed receipts for API/package/algorithm/math. Editing docs, prompts, or skills that merely mention computer-use does not by itself make the computer-use suite applicable; pick the red-team surface that matches what the change actually ships.
|
|
@@ -289,7 +343,7 @@ The native `checkpoint --status complete` command rejects missing or shallow gat
|
|
|
289
343
|
|
|
290
344
|
Provide one `artifactRefs` entry per live surface actually exercised, using the surface-appropriate `kind` and evidence rules from steps 6–7 above; the CLI rejects missing or shallow gates. `status: "not_applicable"` rows are allowed only in `contractCoverage` and `surfaceEvidence` and each requires `contractRef` plus `reason`.
|
|
291
345
|
|
|
292
|
-
For CLI replay artifacts, the JSON at `path` must be an object like `{"schemaVersion":1,"kind":"cli-replay","replaySafe":true,"command":["bun","-e","console.log(\"ultragoal-cli-ok\")"],"recordedStdout":"ultragoal-cli-ok\n"}`.
|
|
346
|
+
For CLI replay artifacts, the JSON at `path` must be an object like `{"schemaVersion":1,"kind":"cli-replay","replaySafe":true,"command":["bun","-e","console.log(\"ultragoal-cli-ok\")"],"cwd":".","env":{"LC_ALL":"C"},"timeoutMs":30000,"expectedExitCode":0,"recordedStdout":"ultragoal-cli-ok\n","recordedStderr":"","invariants":[{"type":"substring","value":"ultragoal-cli-ok"},{"type":"not-substring","value":"error"}]}`. Accepted replay fields are `command` (string array), optional `cwd`, safe `env`, `timeoutMs`, `expectedExitCode`, `recordedStdout`, `recordedStderr`, `normalization`, and `invariants`. The conservative command allowlist is intentionally small: `bun --version`, `node --version`, deterministic `bun/node -e "console.log(...)"`, `npm|pnpm|yarn --version`, `npm|pnpm|yarn list`, read-only `git status|rev-parse|merge-base|diff|show|log` with safe args, and `gjc read|status`. `env` must contain only safe deterministic variables, never credentials or machine/user-specific secrets. `normalization` is optional and, when provided, must be exactly the string `"default"` (the built-in normalizer already strips ANSI codes, normalizes line endings, scrubs paths, and trims trailing whitespace); object-shaped normalization is rejected. Invariants may be substring, regex, or not-substring checks; when present, they replace exact `recordedStdout` equality — without `invariants`, replayed normalized stdout must match `recordedStdout` exactly. Unsafe, non-deterministic, credentialed, interactive, or otherwise unallowlisted commands require audited `replayExempt` metadata with exact fields `reasonCode`, `reason`, `approvedBy`, and `fallbackArtifactRefs` plus a structurally valid same-surface fallback artifact. `reason` must be substantive and audited, and `approvedBy` must identify the verifier. Allowed `reasonCode` values are exactly `unsafe_side_effect`, `requires_credentials`, `requires_network`, `non_deterministic_external`, `destructive`, `interactive_only`, and `platform_unavailable`.
|
|
293
347
|
|
|
294
348
|
## Review mode
|
|
295
349
|
|
|
@@ -299,6 +353,7 @@ Receipts are freshness-scoped:
|
|
|
299
353
|
- Per-goal receipts remain fresh for their target goal unless that goal, its blocker metadata, or its supersession metadata changes.
|
|
300
354
|
- Normal later `goal_started` or clean receipt-backed `goal_checkpointed` events for other goals do not stale older per-goal receipts.
|
|
301
355
|
- Appending required goals or changing final required-goal state stales final aggregate receipts. Final aggregate completion requires a fresh final aggregate receipt proving no incomplete, blocked, or `review_blocked` required goals remain.
|
|
356
|
+
- Deferred per-goal receipts (validation-batch members) are incomplete until a matching fresh batch-close receipt exists on the batch's `finalGoalId`; a story-scope query for a deferred member stays blocked until that close, and mutating a member after close stales the batch-close and final aggregate receipts.
|
|
302
357
|
|
|
303
358
|
## Handoff back to planning
|
|
304
359
|
|