specrails-core 5.5.1 → 6.0.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.
- package/README.md +27 -145
- package/bin/specrails-core.mjs +12 -554
- package/dist/agent-runtime/capabilities.js +0 -1
- package/dist/agent-runtime/cli-executor.d.ts +1 -1
- package/dist/agent-runtime/cli-executor.js +4 -3
- package/dist/agent-runtime/cli-process.js +0 -1
- package/dist/agent-runtime/cli.d.ts +8 -0
- package/dist/agent-runtime/cli.js +31 -5
- package/dist/agent-runtime/codex-schema.js +0 -1
- package/dist/agent-runtime/compact/architect.d.ts +3 -272
- package/dist/agent-runtime/compact/architect.js +8 -9
- package/dist/agent-runtime/compact/chat-client.d.ts +3 -3
- package/dist/agent-runtime/compact/chat-client.js +1 -2
- package/dist/agent-runtime/compact/developer.d.ts +3 -70
- package/dist/agent-runtime/compact/developer.js +13 -14
- package/dist/agent-runtime/compact/environment.d.ts +4 -5
- package/dist/agent-runtime/compact/environment.js +1 -2
- package/dist/agent-runtime/compact/exit-code-honesty.d.ts +2 -1
- package/dist/agent-runtime/compact/exit-code-honesty.js +0 -1
- package/dist/agent-runtime/compact/guarded-loop.d.ts +2 -18
- package/dist/agent-runtime/compact/guarded-loop.js +7 -8
- package/dist/agent-runtime/compact/prompt-inputs.d.ts +0 -2
- package/dist/agent-runtime/compact/prompt-inputs.js +1 -2
- package/dist/agent-runtime/compact/reviewer.d.ts +0 -13
- package/dist/agent-runtime/compact/reviewer.js +5 -6
- package/dist/agent-runtime/compact/step.d.ts +0 -1
- package/dist/agent-runtime/compact/step.js +1 -2
- package/dist/agent-runtime/compact/test-reachability.js +0 -1
- package/dist/agent-runtime/config.js +0 -1
- package/dist/agent-runtime/core-host.d.ts +1 -1
- package/dist/agent-runtime/core-host.js +5 -3
- package/dist/agent-runtime/durable-store.d.ts +0 -1
- package/dist/agent-runtime/durable-store.js +1 -2
- package/dist/agent-runtime/efficiency-summary.d.ts +2 -2
- package/dist/agent-runtime/efficiency-summary.js +1 -2
- package/dist/agent-runtime/efficiency-types.js +0 -1
- package/dist/agent-runtime/efficiency.js +0 -1
- package/dist/agent-runtime/evaluation-corpus.js +0 -1
- package/dist/agent-runtime/evaluation.d.ts +2 -1
- package/dist/agent-runtime/evaluation.js +1 -2
- package/dist/agent-runtime/executor-types.d.ts +1 -1
- package/dist/agent-runtime/executor-types.js +0 -1
- package/dist/agent-runtime/executors.js +0 -1
- package/dist/agent-runtime/gemini-policy.js +0 -1
- package/dist/agent-runtime/graph/artifacts.d.ts +1 -1
- package/dist/agent-runtime/graph/artifacts.js +11 -5
- package/dist/agent-runtime/graph/nodes.d.ts +1 -1
- package/dist/agent-runtime/graph/nodes.js +1 -2
- package/dist/agent-runtime/graph/review-policy.js +0 -1
- package/dist/agent-runtime/graph/roles.d.ts +2 -5
- package/dist/agent-runtime/graph/roles.js +2 -8
- package/dist/agent-runtime/graph/state.d.ts +1 -1
- package/dist/agent-runtime/graph/state.js +0 -1
- package/dist/agent-runtime/graph-checkpointer.d.ts +2 -1
- package/dist/agent-runtime/graph-checkpointer.js +0 -1
- package/dist/agent-runtime/guardrails.d.ts +3 -3
- package/dist/agent-runtime/guardrails.js +1 -2
- package/dist/agent-runtime/index.d.ts +2 -1
- package/dist/agent-runtime/index.js +2 -2
- package/dist/agent-runtime/kimi-acp.js +1 -2
- package/dist/agent-runtime/kimi-model.d.ts +6 -0
- package/dist/agent-runtime/kimi-model.js +12 -0
- package/dist/agent-runtime/openai-executor.d.ts +0 -9
- package/dist/agent-runtime/openai-executor.js +6 -7
- package/dist/agent-runtime/openspec-tool-server.js +1 -2
- package/dist/agent-runtime/openspec.d.ts +0 -2
- package/dist/agent-runtime/openspec.js +3 -7
- package/dist/agent-runtime/prompts.d.ts +4 -3
- package/dist/agent-runtime/prompts.js +0 -1
- package/dist/agent-runtime/provider-diagnostic.js +1 -2
- package/dist/agent-runtime/recovery.d.ts +46 -0
- package/dist/agent-runtime/recovery.js +169 -0
- package/dist/agent-runtime/repository-context.d.ts +1 -1
- package/dist/agent-runtime/repository-context.js +0 -1
- package/dist/agent-runtime/review-context.d.ts +1 -1
- package/dist/agent-runtime/review-context.js +0 -1
- package/dist/agent-runtime/role-routing.js +0 -1
- package/dist/agent-runtime/role-state.js +0 -1
- package/dist/agent-runtime/runtime-identity.js +1 -2
- package/dist/agent-runtime/tool-event.js +0 -1
- package/dist/agent-runtime/verification-plan.d.ts +5 -4
- package/dist/agent-runtime/verification-plan.js +1 -2
- package/dist/agent-runtime/workflow-types.js +0 -1
- package/dist/agent-runtime/workflow.js +0 -1
- package/dist/agent-runtime/workspace-tools.d.ts +2 -2
- package/dist/agent-runtime/workspace-tools.js +1 -2
- package/dist/installer/cli.d.ts +3 -32
- package/dist/installer/cli.js +26 -101
- package/dist/installer/commands/framework.d.ts +4 -3
- package/dist/installer/commands/framework.js +0 -1
- package/dist/installer/commands/init.d.ts +4 -25
- package/dist/installer/commands/init.js +5 -8
- package/dist/installer/phases/framework-lifecycle.d.ts +3 -17
- package/dist/installer/phases/framework-lifecycle.js +2 -3
- package/dist/installer/phases/install-config.d.ts +7 -8
- package/dist/installer/phases/install-config.js +2 -7
- package/dist/installer/phases/manifest.d.ts +6 -7
- package/dist/installer/phases/manifest.js +2 -7
- package/dist/installer/phases/prereqs.d.ts +6 -7
- package/dist/installer/phases/prereqs.js +4 -6
- package/dist/installer/phases/provider-detect.d.ts +6 -7
- package/dist/installer/phases/provider-detect.js +2 -4
- package/dist/installer/phases/scaffold.d.ts +9 -10
- package/dist/installer/phases/scaffold.js +82 -805
- package/dist/installer/util/errors.js +0 -1
- package/dist/installer/util/exec.d.ts +3 -2
- package/dist/installer/util/exec.js +0 -1
- package/dist/installer/util/fs.d.ts +0 -10
- package/dist/installer/util/fs.js +1 -2
- package/dist/installer/util/git.js +0 -1
- package/dist/installer/util/install-transaction.d.ts +2 -2
- package/dist/installer/util/install-transaction.js +1 -2
- package/dist/installer/util/logger.d.ts +1 -3
- package/dist/installer/util/logger.js +0 -1
- package/dist/installer/util/paths.js +0 -1
- package/dist/installer/util/registry.d.ts +4 -8
- package/dist/installer/util/registry.js +2 -3
- package/dist/{installer/runtime → pipeline}/pipeline-state.js +0 -3
- package/dist/shared/args.d.ts +18 -0
- package/dist/shared/args.js +53 -0
- package/integration-contract.json +10 -46
- package/package.json +3 -10
- package/templates/agents/sr-architect.md +15 -310
- package/templates/agents/sr-developer.md +15 -269
- package/templates/agents/sr-reviewer.md +13 -367
- package/templates/codex-skills/rails/sr-architect/SKILL.md +14 -308
- package/templates/codex-skills/rails/sr-developer/SKILL.md +14 -201
- package/templates/codex-skills/rails/sr-reviewer/SKILL.md +15 -289
- package/templates/kimi/specrails/run-skill.mjs +91 -2173
- package/bin/tui-installer.mjs +0 -430
- package/commands/doctor.md +0 -62
- package/dist/agent-runtime/capabilities.js.map +0 -1
- package/dist/agent-runtime/cli-executor.js.map +0 -1
- package/dist/agent-runtime/cli-process.js.map +0 -1
- package/dist/agent-runtime/cli.js.map +0 -1
- package/dist/agent-runtime/codex-schema.js.map +0 -1
- package/dist/agent-runtime/compact/architect.js.map +0 -1
- package/dist/agent-runtime/compact/chat-client.js.map +0 -1
- package/dist/agent-runtime/compact/developer.js.map +0 -1
- package/dist/agent-runtime/compact/environment.js.map +0 -1
- package/dist/agent-runtime/compact/exit-code-honesty.js.map +0 -1
- package/dist/agent-runtime/compact/guarded-loop.js.map +0 -1
- package/dist/agent-runtime/compact/prompt-inputs.js.map +0 -1
- package/dist/agent-runtime/compact/reviewer.js.map +0 -1
- package/dist/agent-runtime/compact/step.js.map +0 -1
- package/dist/agent-runtime/compact/test-reachability.js.map +0 -1
- package/dist/agent-runtime/config.js.map +0 -1
- package/dist/agent-runtime/core-host.js.map +0 -1
- package/dist/agent-runtime/durable-store.js.map +0 -1
- package/dist/agent-runtime/efficiency-summary.js.map +0 -1
- package/dist/agent-runtime/efficiency-types.js.map +0 -1
- package/dist/agent-runtime/efficiency.js.map +0 -1
- package/dist/agent-runtime/evaluation-corpus.js.map +0 -1
- package/dist/agent-runtime/evaluation.js.map +0 -1
- package/dist/agent-runtime/executor-types.js.map +0 -1
- package/dist/agent-runtime/executors.js.map +0 -1
- package/dist/agent-runtime/gemini-policy.js.map +0 -1
- package/dist/agent-runtime/graph/artifacts.js.map +0 -1
- package/dist/agent-runtime/graph/nodes.js.map +0 -1
- package/dist/agent-runtime/graph/review-policy.js.map +0 -1
- package/dist/agent-runtime/graph/roles.js.map +0 -1
- package/dist/agent-runtime/graph/state.js.map +0 -1
- package/dist/agent-runtime/graph-checkpointer.js.map +0 -1
- package/dist/agent-runtime/guardrails.js.map +0 -1
- package/dist/agent-runtime/index.js.map +0 -1
- package/dist/agent-runtime/kimi-acp.js.map +0 -1
- package/dist/agent-runtime/openai-executor.js.map +0 -1
- package/dist/agent-runtime/openspec-tool-server.js.map +0 -1
- package/dist/agent-runtime/openspec.js.map +0 -1
- package/dist/agent-runtime/prompts.js.map +0 -1
- package/dist/agent-runtime/provider-diagnostic.js.map +0 -1
- package/dist/agent-runtime/repository-context.js.map +0 -1
- package/dist/agent-runtime/review-context.js.map +0 -1
- package/dist/agent-runtime/role-routing.js.map +0 -1
- package/dist/agent-runtime/role-state.js.map +0 -1
- package/dist/agent-runtime/runtime-identity.js.map +0 -1
- package/dist/agent-runtime/tool-event.js.map +0 -1
- package/dist/agent-runtime/verification-plan.js.map +0 -1
- package/dist/agent-runtime/workflow-types.js.map +0 -1
- package/dist/agent-runtime/workflow.js.map +0 -1
- package/dist/agent-runtime/workspace-tools.js.map +0 -1
- package/dist/installer/cli.js.map +0 -1
- package/dist/installer/commands/doctor.d.ts +0 -27
- package/dist/installer/commands/doctor.js +0 -615
- package/dist/installer/commands/doctor.js.map +0 -1
- package/dist/installer/commands/framework.js.map +0 -1
- package/dist/installer/commands/init.js.map +0 -1
- package/dist/installer/commands/update.d.ts +0 -56
- package/dist/installer/commands/update.js +0 -257
- package/dist/installer/commands/update.js.map +0 -1
- package/dist/installer/commands/v5-migration.d.ts +0 -32
- package/dist/installer/commands/v5-migration.js +0 -133
- package/dist/installer/commands/v5-migration.js.map +0 -1
- package/dist/installer/phases/framework-lifecycle.js.map +0 -1
- package/dist/installer/phases/install-config.js.map +0 -1
- package/dist/installer/phases/manifest.js.map +0 -1
- package/dist/installer/phases/prereqs.js.map +0 -1
- package/dist/installer/phases/provider-detect.js.map +0 -1
- package/dist/installer/phases/scaffold.js.map +0 -1
- package/dist/installer/runtime/kimi.d.ts +0 -84
- package/dist/installer/runtime/kimi.js +0 -255
- package/dist/installer/runtime/kimi.js.map +0 -1
- package/dist/installer/runtime/pipeline-state.js.map +0 -1
- package/dist/installer/util/errors.js.map +0 -1
- package/dist/installer/util/exec.js.map +0 -1
- package/dist/installer/util/fs.js.map +0 -1
- package/dist/installer/util/git.js.map +0 -1
- package/dist/installer/util/install-transaction.js.map +0 -1
- package/dist/installer/util/logger.js.map +0 -1
- package/dist/installer/util/paths.js.map +0 -1
- package/dist/installer/util/prompts.d.ts +0 -23
- package/dist/installer/util/prompts.js +0 -49
- package/dist/installer/util/prompts.js.map +0 -1
- package/dist/installer/util/registry.js.map +0 -1
- package/dist/installer/util/template.d.ts +0 -23
- package/dist/installer/util/template.js +0 -60
- package/dist/installer/util/template.js.map +0 -1
- package/docs/README.md +0 -40
- package/docs/agent-runtime-efficiency.md +0 -65
- package/docs/agent-runtime.md +0 -347
- package/docs/agents.md +0 -315
- package/docs/changelog.md +0 -168
- package/docs/ci-cd.md +0 -60
- package/docs/concepts.md +0 -183
- package/docs/customization.md +0 -363
- package/docs/deployment.md +0 -234
- package/docs/getting-started.md +0 -122
- package/docs/installation.md +0 -395
- package/docs/local-tickets.md +0 -191
- package/docs/migration-guide.md +0 -140
- package/docs/playbook-oss-maintainer.md +0 -112
- package/docs/playbook-parallel-dev.md +0 -124
- package/docs/playbook-product-discovery.md +0 -115
- package/docs/plugin-architecture.md +0 -144
- package/docs/research/codex-compatibility-analysis.md +0 -365
- package/docs/research/mcp-feasibility-analysis.md +0 -382
- package/docs/testing/test-matrix-codex.md +0 -130
- package/docs/updating.md +0 -89
- package/docs/user-docs/cli-reference.md +0 -428
- package/docs/user-docs/codex-vs-claude-code.md +0 -23
- package/docs/user-docs/core-updates.md +0 -70
- package/docs/user-docs/faq.md +0 -146
- package/docs/user-docs/getting-started-codex.md +0 -194
- package/docs/user-docs/getting-started-kimi.md +0 -423
- package/docs/user-docs/installation.md +0 -237
- package/docs/user-docs/provider-pipelines.md +0 -96
- package/docs/user-docs/quick-start.md +0 -161
- package/docs/windows.md +0 -78
- package/docs/workflows.md +0 -463
- package/schemas/profile.v1.json +0 -207
- package/templates/claude-md/CLAUDE-quickstart.md +0 -54
- package/templates/claude-md/root.md +0 -50
- package/templates/codex-skills/batch-implement/SKILL.md +0 -38
- package/templates/codex-skills/implement/SKILL.md +0 -38
- package/templates/codex-skills/retry/SKILL.md +0 -16
- package/templates/commands/specrails/compat-check.md +0 -271
- package/templates/commands/specrails/doctor.md +0 -62
- package/templates/commands/specrails/explore-spec.md +0 -173
- package/templates/commands/specrails/health-check.md +0 -527
- package/templates/commands/specrails/memory-inspect.md +0 -261
- package/templates/commands/specrails/opsx-diff.md +0 -419
- package/templates/commands/specrails/propose-spec.md +0 -102
- package/templates/commands/specrails/refactor-recommender.md +0 -169
- package/templates/commands/specrails/telemetry.md +0 -552
- package/templates/commands/specrails/why.md +0 -96
- package/templates/gemini-commands/batch-implement.toml +0 -37
- package/templates/gemini-commands/implement.toml +0 -37
- package/templates/gemini-commands/retry.toml +0 -15
- package/templates/profiles/default.json +0 -14
- package/templates/profiles/kimi-default.json +0 -15
- package/templates/rules/layer.md +0 -8
- package/templates/runtime/provider-pipeline.md +0 -113
- package/templates/security/security-exemptions.yaml +0 -20
- package/templates/settings/confidence-config.json +0 -17
- package/templates/settings/settings.json +0 -15
- /package/dist/{installer/runtime → pipeline}/pipeline-state.d.ts +0 -0
|
@@ -5,8 +5,8 @@ import { rolePromptDefaults } from './prompts.js';
|
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from 'node:fs';
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { pathToFileURL } from 'node:url';
|
|
8
|
-
import { parseArgs } from '../
|
|
9
|
-
import { readVerificationEvidence, inspectPipeline, pipelineStateDirectory, validatePipelineContext } from '../
|
|
8
|
+
import { parseArgs } from '../shared/args.js';
|
|
9
|
+
import { readVerificationEvidence, inspectPipeline, pipelineStateDirectory, validatePipelineContext } from '../pipeline/pipeline-state.js';
|
|
10
10
|
import { normalizeRuntimeConfig, validateRuntimeConfig } from './config.js';
|
|
11
11
|
import { CORE_PACKAGE_VERSION, CORE_WORKFLOW_VERSION, RUNTIME_API_VERSION, coreRuntimeIdentity, preflightCoreWorkflow, runCoreWorkflow } from './core-host.js';
|
|
12
12
|
import { sameRuntimeIdentity } from './runtime-identity.js';
|
|
@@ -14,6 +14,7 @@ import { readWorkflowState } from './workflow.js';
|
|
|
14
14
|
import { runtimeEfficiency } from './efficiency.js';
|
|
15
15
|
import { configuredCapabilities } from './capabilities.js';
|
|
16
16
|
import { createExecutorRegistry } from './executors.js';
|
|
17
|
+
import { runRecovery } from './recovery.js';
|
|
17
18
|
function read(file) { return JSON.parse(readFileSync(file, 'utf8')); }
|
|
18
19
|
async function readStdin() {
|
|
19
20
|
const chunks = [];
|
|
@@ -35,6 +36,12 @@ export function compactState(state) {
|
|
|
35
36
|
runId: state.runId, traceId: state.traceId, status: state.status, nextStep: state.nextStep, updatedAt: state.updatedAt,
|
|
36
37
|
error: state.error, pendingApproval: state.pendingApproval, pendingQuestion: state.pendingQuestion, usage: state.usage,
|
|
37
38
|
steps: Object.fromEntries(Object.entries(state.steps).map(([id, step]) => [id, { status: step.status, visits: step.visits }])),
|
|
39
|
+
// Bounded failure history helps hosts distinguish repeated blockers from a
|
|
40
|
+
// resumable checkpoint without shipping transcripts or invoking a provider.
|
|
41
|
+
recentFailures: state.history.filter(attempt => attempt.status === 'failed' || attempt.status === 'interrupted').slice(-8).map(attempt => ({
|
|
42
|
+
stepId: attempt.stepId, status: attempt.status, attempt: attempt.attempt, visit: attempt.visit,
|
|
43
|
+
at: attempt.completedAt ?? attempt.startedAt, error: attempt.error?.slice(-6000),
|
|
44
|
+
})),
|
|
38
45
|
metrics: runtimeEfficiency(state),
|
|
39
46
|
};
|
|
40
47
|
}
|
|
@@ -81,7 +88,7 @@ function invocationUsage(state, priorCount) {
|
|
|
81
88
|
return { costUsd: sum('costUsd'), inputTokens: sum('inputTokens'), outputTokens: sum('outputTokens') };
|
|
82
89
|
}
|
|
83
90
|
export async function runRuntimeCommand(flags, positionals, emit = value => process.stdout.write(JSON.stringify(value) + '\n')) {
|
|
84
|
-
const command = positionals[0] ?? 'help';
|
|
91
|
+
const command = flags.help === true ? 'help' : positionals[0] ?? 'help';
|
|
85
92
|
if (command === 'prompts') {
|
|
86
93
|
emit({ type: 'runtime-role-prompts', defaults: rolePromptDefaults() });
|
|
87
94
|
return 0;
|
|
@@ -114,11 +121,12 @@ export async function runRuntimeCommand(flags, positionals, emit = value => proc
|
|
|
114
121
|
'specrails-core runtime run --context <json> --config <json> --change <kebab-case>',
|
|
115
122
|
'specrails-core runtime status --context <json> [--compact]',
|
|
116
123
|
'specrails-core runtime resume --context <json> [--approve archive] [--answer <text>] [--recover developer] [--invalidate verify]',
|
|
124
|
+
'specrails-core runtime recovery --context <json> --stdin',
|
|
117
125
|
] });
|
|
118
126
|
return 0;
|
|
119
127
|
}
|
|
120
128
|
if (command === 'api') {
|
|
121
|
-
emit({ type: 'runtime-api', apiVersion: RUNTIME_API_VERSION, coreVersion: CORE_PACKAGE_VERSION, runtimeIdentity: coreRuntimeIdentity(), workflowVersions: [CORE_WORKFLOW_VERSION], capabilities: { efficientRoleExecution: 1, reproducibleVerification: 1, implementationEfficiencyMetrics: 1, compactAgentLoop: 1, configurableGuardrails: 1, compactOutputBudget: 1, roleThinkingControl: 1 }, guardrails: GUARDRAIL_CATALOG });
|
|
129
|
+
emit({ type: 'runtime-api', apiVersion: RUNTIME_API_VERSION, coreVersion: CORE_PACKAGE_VERSION, runtimeIdentity: coreRuntimeIdentity(), workflowVersions: [CORE_WORKFLOW_VERSION], capabilities: { scopedRecovery: 1, efficientRoleExecution: 1, reproducibleVerification: 1, implementationEfficiencyMetrics: 1, compactAgentLoop: 1, configurableGuardrails: 1, compactOutputBudget: 1, roleThinkingControl: 1 }, guardrails: GUARDRAIL_CATALOG });
|
|
122
130
|
return 0;
|
|
123
131
|
}
|
|
124
132
|
if (command === 'validate') {
|
|
@@ -136,6 +144,25 @@ export async function runRuntimeCommand(flags, positionals, emit = value => proc
|
|
|
136
144
|
emit(readVerificationEvidence(context, query));
|
|
137
145
|
return 0;
|
|
138
146
|
}
|
|
147
|
+
if (command === 'recovery') {
|
|
148
|
+
if (flags.stdin !== true || Object.keys(flags).some(key => !['context', 'stdin'].includes(key)))
|
|
149
|
+
throw new Error('Recovery requires --context and --stdin only');
|
|
150
|
+
const context = validatePipelineContext(read(stringFlag(flags, 'context')));
|
|
151
|
+
const request = read(path.join(pipelineStateDirectory(context), 'agent-runtime-request.json'));
|
|
152
|
+
if (!request.runtimeIdentity || !sameRuntimeIdentity(request.runtimeIdentity, coreRuntimeIdentity()))
|
|
153
|
+
throw new Error('Recovery requires the retained original runtime identity; do not replace or migrate the saved run');
|
|
154
|
+
const controller = new AbortController(), abort = () => controller.abort();
|
|
155
|
+
process.on('SIGINT', abort);
|
|
156
|
+
process.on('SIGTERM', abort);
|
|
157
|
+
try {
|
|
158
|
+
emit({ type: 'runtime-recovery', schemaVersion: 1, runId: context.runId, result: await runRecovery(context, await readStdin(), controller.signal) });
|
|
159
|
+
return 0;
|
|
160
|
+
}
|
|
161
|
+
finally {
|
|
162
|
+
process.off('SIGINT', abort);
|
|
163
|
+
process.off('SIGTERM', abort);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
139
166
|
if (!['run', 'status', 'resume'].includes(command))
|
|
140
167
|
throw new Error('Unknown runtime operation: ' + command);
|
|
141
168
|
const context = validatePipelineContext(read(stringFlag(flags, 'context')));
|
|
@@ -214,4 +241,3 @@ if (process.argv[1] && existsSync(process.argv[1]) && import.meta.url === pathTo
|
|
|
214
241
|
process.exitCode = 1;
|
|
215
242
|
}
|
|
216
243
|
}
|
|
217
|
-
//# sourceMappingURL=cli.js.map
|
|
@@ -28,4 +28,3 @@ export function restoreOptionalFields(value, schema) {
|
|
|
28
28
|
return Object.fromEntries(Object.entries(value).filter(([key, item]) => !(key in properties && item === null && !required.has(key)))
|
|
29
29
|
.map(([key, item]) => [key, properties[key] ? restoreOptionalFields(item, properties[key]) : item]));
|
|
30
30
|
}
|
|
31
|
-
//# sourceMappingURL=codex-schema.js.map
|
|
@@ -2,38 +2,7 @@ import type { AgentResult } from '../executor-types.js';
|
|
|
2
2
|
import { type CompactEnv } from './step.js';
|
|
3
3
|
/** The load-bearing tokens of a criterion: identifiers (`createGame`, `applyInput`, `tick`), numbers and hyphenated terms — never prose words. */
|
|
4
4
|
export declare function criterionTokens(text: string): string[];
|
|
5
|
-
|
|
6
|
-
greenfield: boolean;
|
|
7
|
-
languages: string[];
|
|
8
|
-
frameworks: string[];
|
|
9
|
-
keyFiles: string[];
|
|
10
|
-
tests: string[];
|
|
11
|
-
notes: string;
|
|
12
|
-
}
|
|
13
|
-
export interface Proposal {
|
|
14
|
-
why: string;
|
|
15
|
-
whatChanges: string[];
|
|
16
|
-
capabilities: {
|
|
17
|
-
new: string[];
|
|
18
|
-
modified: string[];
|
|
19
|
-
};
|
|
20
|
-
impact: string[];
|
|
21
|
-
}
|
|
22
|
-
export interface Design {
|
|
23
|
-
context: string;
|
|
24
|
-
goals: string[];
|
|
25
|
-
nonGoals: string[];
|
|
26
|
-
decisions: {
|
|
27
|
-
title: string;
|
|
28
|
-
choice: string;
|
|
29
|
-
why: string;
|
|
30
|
-
}[];
|
|
31
|
-
risks: {
|
|
32
|
-
risk: string;
|
|
33
|
-
mitigation: string;
|
|
34
|
-
}[];
|
|
35
|
-
}
|
|
36
|
-
export interface Spec {
|
|
5
|
+
interface Spec {
|
|
37
6
|
name: string;
|
|
38
7
|
requirements: {
|
|
39
8
|
name: string;
|
|
@@ -45,7 +14,7 @@ export interface Spec {
|
|
|
45
14
|
}[];
|
|
46
15
|
}[];
|
|
47
16
|
}
|
|
48
|
-
|
|
17
|
+
interface Tasks {
|
|
49
18
|
groups: {
|
|
50
19
|
title: string;
|
|
51
20
|
tasks: string[];
|
|
@@ -57,245 +26,6 @@ export interface Tasks {
|
|
|
57
26
|
}[];
|
|
58
27
|
blockingQuestion?: string;
|
|
59
28
|
}
|
|
60
|
-
export declare const INVENTORY_SCHEMA: {
|
|
61
|
-
type: string;
|
|
62
|
-
additionalProperties: boolean;
|
|
63
|
-
required: string[];
|
|
64
|
-
properties: {
|
|
65
|
-
greenfield: {
|
|
66
|
-
type: string;
|
|
67
|
-
};
|
|
68
|
-
languages: {
|
|
69
|
-
type: string;
|
|
70
|
-
items: {
|
|
71
|
-
type: string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
frameworks: {
|
|
75
|
-
type: string;
|
|
76
|
-
items: {
|
|
77
|
-
type: string;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
keyFiles: {
|
|
81
|
-
type: string;
|
|
82
|
-
items: {
|
|
83
|
-
type: string;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
tests: {
|
|
87
|
-
type: string;
|
|
88
|
-
items: {
|
|
89
|
-
type: string;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
notes: {
|
|
93
|
-
type: string;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
export declare const PROPOSAL_SCHEMA: {
|
|
98
|
-
type: string;
|
|
99
|
-
additionalProperties: boolean;
|
|
100
|
-
required: string[];
|
|
101
|
-
properties: {
|
|
102
|
-
why: {
|
|
103
|
-
type: string;
|
|
104
|
-
};
|
|
105
|
-
whatChanges: {
|
|
106
|
-
type: string;
|
|
107
|
-
items: {
|
|
108
|
-
type: string;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
capabilities: {
|
|
112
|
-
type: string;
|
|
113
|
-
additionalProperties: boolean;
|
|
114
|
-
required: string[];
|
|
115
|
-
properties: {
|
|
116
|
-
new: {
|
|
117
|
-
type: string;
|
|
118
|
-
items: {
|
|
119
|
-
type: string;
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
modified: {
|
|
123
|
-
type: string;
|
|
124
|
-
items: {
|
|
125
|
-
type: string;
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
impact: {
|
|
131
|
-
type: string;
|
|
132
|
-
items: {
|
|
133
|
-
type: string;
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
export declare const DESIGN_SCHEMA: {
|
|
139
|
-
type: string;
|
|
140
|
-
additionalProperties: boolean;
|
|
141
|
-
required: string[];
|
|
142
|
-
properties: {
|
|
143
|
-
context: {
|
|
144
|
-
type: string;
|
|
145
|
-
};
|
|
146
|
-
goals: {
|
|
147
|
-
type: string;
|
|
148
|
-
items: {
|
|
149
|
-
type: string;
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
nonGoals: {
|
|
153
|
-
type: string;
|
|
154
|
-
items: {
|
|
155
|
-
type: string;
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
decisions: {
|
|
159
|
-
type: string;
|
|
160
|
-
items: {
|
|
161
|
-
type: string;
|
|
162
|
-
additionalProperties: boolean;
|
|
163
|
-
required: string[];
|
|
164
|
-
properties: {
|
|
165
|
-
title: {
|
|
166
|
-
type: string;
|
|
167
|
-
};
|
|
168
|
-
choice: {
|
|
169
|
-
type: string;
|
|
170
|
-
};
|
|
171
|
-
why: {
|
|
172
|
-
type: string;
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
risks: {
|
|
178
|
-
type: string;
|
|
179
|
-
items: {
|
|
180
|
-
type: string;
|
|
181
|
-
additionalProperties: boolean;
|
|
182
|
-
required: string[];
|
|
183
|
-
properties: {
|
|
184
|
-
risk: {
|
|
185
|
-
type: string;
|
|
186
|
-
};
|
|
187
|
-
mitigation: {
|
|
188
|
-
type: string;
|
|
189
|
-
};
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
export declare const SPEC_SCHEMA: {
|
|
196
|
-
type: string;
|
|
197
|
-
additionalProperties: boolean;
|
|
198
|
-
required: string[];
|
|
199
|
-
properties: {
|
|
200
|
-
name: {
|
|
201
|
-
type: string;
|
|
202
|
-
};
|
|
203
|
-
requirements: {
|
|
204
|
-
type: string;
|
|
205
|
-
items: {
|
|
206
|
-
type: string;
|
|
207
|
-
additionalProperties: boolean;
|
|
208
|
-
required: string[];
|
|
209
|
-
properties: {
|
|
210
|
-
name: {
|
|
211
|
-
type: string;
|
|
212
|
-
};
|
|
213
|
-
text: {
|
|
214
|
-
type: string;
|
|
215
|
-
};
|
|
216
|
-
scenarios: {
|
|
217
|
-
type: string;
|
|
218
|
-
items: {
|
|
219
|
-
type: string;
|
|
220
|
-
additionalProperties: boolean;
|
|
221
|
-
required: string[];
|
|
222
|
-
properties: {
|
|
223
|
-
name: {
|
|
224
|
-
type: string;
|
|
225
|
-
};
|
|
226
|
-
when: {
|
|
227
|
-
type: string;
|
|
228
|
-
};
|
|
229
|
-
then: {
|
|
230
|
-
type: string;
|
|
231
|
-
};
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
|
-
export declare const TASKS_SCHEMA: {
|
|
241
|
-
type: string;
|
|
242
|
-
additionalProperties: boolean;
|
|
243
|
-
required: string[];
|
|
244
|
-
properties: {
|
|
245
|
-
groups: {
|
|
246
|
-
type: string;
|
|
247
|
-
items: {
|
|
248
|
-
type: string;
|
|
249
|
-
additionalProperties: boolean;
|
|
250
|
-
required: string[];
|
|
251
|
-
properties: {
|
|
252
|
-
title: {
|
|
253
|
-
type: string;
|
|
254
|
-
};
|
|
255
|
-
tasks: {
|
|
256
|
-
type: string;
|
|
257
|
-
items: {
|
|
258
|
-
type: string;
|
|
259
|
-
};
|
|
260
|
-
};
|
|
261
|
-
};
|
|
262
|
-
};
|
|
263
|
-
};
|
|
264
|
-
verification: {
|
|
265
|
-
type: string;
|
|
266
|
-
items: {
|
|
267
|
-
type: string;
|
|
268
|
-
additionalProperties: boolean;
|
|
269
|
-
required: string[];
|
|
270
|
-
properties: {
|
|
271
|
-
repositoryId: {
|
|
272
|
-
type: string;
|
|
273
|
-
};
|
|
274
|
-
command: {
|
|
275
|
-
type: string;
|
|
276
|
-
};
|
|
277
|
-
args: {
|
|
278
|
-
type: string;
|
|
279
|
-
items: {
|
|
280
|
-
type: string;
|
|
281
|
-
};
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
};
|
|
285
|
-
};
|
|
286
|
-
blockingQuestion: {
|
|
287
|
-
type: string;
|
|
288
|
-
};
|
|
289
|
-
};
|
|
290
|
-
};
|
|
291
|
-
/** True when no repository holds anything but OpenSpec artifacts and repository boilerplate. */
|
|
292
|
-
export declare function hostGreenfield(roots: string[]): boolean;
|
|
293
|
-
/** Rendered with the exact headings `openspec instructions proposal` returns. */
|
|
294
|
-
export declare function renderProposal(proposal: Proposal, capabilityNames: {
|
|
295
|
-
new: string[];
|
|
296
|
-
modified: string[];
|
|
297
|
-
}): string;
|
|
298
|
-
export declare function renderDesign(design: Design, greenfield: boolean): string;
|
|
299
29
|
/** True when any media/font file exists under the roots (bounded walk, dot/dependency dirs skipped). */
|
|
300
30
|
export declare function hasBinaryAssets(roots: readonly string[], limit?: number): boolean;
|
|
301
31
|
/**
|
|
@@ -347,3 +77,4 @@ export declare function normalizeTasksForTest(raw: Record<string, unknown>, repo
|
|
|
347
77
|
* the graph's participation and completeness checks pass unchanged.
|
|
348
78
|
*/
|
|
349
79
|
export declare function runCompactArchitect(env: CompactEnv): Promise<AgentResult>;
|
|
80
|
+
export {};
|
|
@@ -29,18 +29,18 @@ const SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
|
29
29
|
const NON_SOURCE = new Set(['openspec', 'README.md', 'README', 'LICENSE', 'LICENSE.md', '.gitignore', '.gitattributes', '.editorconfig', 'CLAUDE.md', 'AGENTS.md', 'GEMINI.md', '.DS_Store']);
|
|
30
30
|
const HIDDEN = /^\./;
|
|
31
31
|
const stringList = { type: 'array', items: { type: 'string' } };
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
const INVENTORY_SCHEMA = { type: 'object', additionalProperties: false, required: ['greenfield', 'languages', 'frameworks', 'keyFiles', 'tests', 'notes'], properties: { greenfield: { type: 'boolean' }, languages: stringList, frameworks: stringList, keyFiles: stringList, tests: stringList, notes: { type: 'string' } } };
|
|
33
|
+
const PROPOSAL_SCHEMA = { type: 'object', additionalProperties: false, required: ['why', 'whatChanges', 'capabilities', 'impact'], properties: { why: { type: 'string' }, whatChanges: stringList, capabilities: { type: 'object', additionalProperties: false, required: ['new', 'modified'], properties: { new: stringList, modified: stringList } }, impact: stringList } };
|
|
34
|
+
const DESIGN_SCHEMA = { type: 'object', additionalProperties: false, required: ['context', 'goals', 'nonGoals', 'decisions', 'risks'], properties: { context: { type: 'string' }, goals: stringList, nonGoals: stringList, decisions: { type: 'array', items: { type: 'object', additionalProperties: false, required: ['title', 'choice', 'why'], properties: { title: { type: 'string' }, choice: { type: 'string' }, why: { type: 'string' } } } }, risks: { type: 'array', items: { type: 'object', additionalProperties: false, required: ['risk', 'mitigation'], properties: { risk: { type: 'string' }, mitigation: { type: 'string' } } } } } };
|
|
35
|
+
const SPEC_SCHEMA = { type: 'object', additionalProperties: false, required: ['name', 'requirements'], properties: { name: { type: 'string' }, requirements: { type: 'array', items: { type: 'object', additionalProperties: false, required: ['name', 'text', 'scenarios'], properties: { name: { type: 'string' }, text: { type: 'string' }, scenarios: { type: 'array', items: { type: 'object', additionalProperties: false, required: ['name', 'when', 'then'], properties: { name: { type: 'string' }, when: { type: 'string' }, then: { type: 'string' } } } } } } } } };
|
|
36
36
|
/** Names the repository's primary language for the plan, so task file names use its extension (a greenfield repository has none yet). */
|
|
37
37
|
function languageLine(roots) {
|
|
38
38
|
const profile = languageProfile(roots);
|
|
39
39
|
return profile ? `\nPrimary language of the repository: ${profile.primary}${profile.others.length ? ` (also present: ${profile.others.join(', ')})` : ''} — name new source files with its extension.` : '';
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
const TASKS_SCHEMA = { type: 'object', additionalProperties: false, required: ['groups'], properties: { groups: { type: 'array', items: { type: 'object', additionalProperties: false, required: ['title', 'tasks'], properties: { title: { type: 'string' }, tasks: stringList } } }, verification: { type: 'array', items: { type: 'object', additionalProperties: false, required: ['repositoryId', 'command', 'args'], properties: { repositoryId: { type: 'string' }, command: { type: 'string' }, args: stringList } } }, blockingQuestion: { type: 'string' } } };
|
|
42
42
|
/** True when no repository holds anything but OpenSpec artifacts and repository boilerplate. */
|
|
43
|
-
|
|
43
|
+
function hostGreenfield(roots) {
|
|
44
44
|
return roots.every(root => {
|
|
45
45
|
if (!existsSync(root))
|
|
46
46
|
return true;
|
|
@@ -50,12 +50,12 @@ export function hostGreenfield(roots) {
|
|
|
50
50
|
function slug(value) { return value.trim().toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 60); }
|
|
51
51
|
function bullets(items, fallback) { return items.length ? items.map(item => `- ${item}`).join('\n') : `- ${fallback}`; }
|
|
52
52
|
/** Rendered with the exact headings `openspec instructions proposal` returns. */
|
|
53
|
-
|
|
53
|
+
function renderProposal(proposal, capabilityNames) {
|
|
54
54
|
return ['## Why', '', proposal.why, '', '## What Changes', '', bullets(proposal.whatChanges, 'See the requirements in the specs of this change.'), '', '## Capabilities', '', '### New Capabilities',
|
|
55
55
|
...(capabilityNames.new.length ? capabilityNames.new.map(name => `- \`${name}\`: ${name.replace(/-/g, ' ')}`) : ['- (none)']), '', '### Modified Capabilities',
|
|
56
56
|
...(capabilityNames.modified.length ? capabilityNames.modified.map(name => `- \`${name}\`: requirements extended by this change`) : ['- (none)']), '', '## Impact', '', bullets(proposal.impact, 'Limited to the repositories in scope.'), ''].join('\n');
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
function renderDesign(design, greenfield) {
|
|
59
59
|
return ['## Context', '', ...(greenfield ? ['The repository has no application code; the spec means building it from scratch.', ''] : []), design.context, '', '## Goals / Non-Goals', '', '**Goals:**', bullets(design.goals, 'Deliver the requested work.'), '', '**Non-Goals:**', bullets(design.nonGoals, 'Anything outside the frozen scope.'), '', '## Decisions', '',
|
|
60
60
|
...(design.decisions.length ? design.decisions.map(item => `- **${item.title}**: ${item.choice} — ${item.why}`) : ['- Follow the existing conventions of the repository.']), '', '## Risks / Trade-offs', '', ...(design.risks.length ? design.risks.map(item => `- [${item.risk}] → ${item.mitigation}`) : ['- [Scope creep] → implement only the listed tasks.']), '', '## Local reference patterns', '', greenfield ? 'No existing implementation to reference: the repository is empty.' : 'See the key files listed in the inventory of this change; no equivalent implementation was verified beyond them.', ''].join('\n');
|
|
61
61
|
}
|
|
@@ -368,4 +368,3 @@ export async function runCompactArchitect(env) {
|
|
|
368
368
|
env.onEvent?.({ kind: 'text', text: `Compact architect: ${specs.length} spec${specs.length === 1 ? '' : 's'}, ${tasks.groups.reduce((total, group) => total + group.tasks.length, 0)} tasks, ${inventoryLoop.toolCalls} inventory tool calls.` });
|
|
369
369
|
return { text: result, usage: env.client.usage, structured };
|
|
370
370
|
}
|
|
371
|
-
//# sourceMappingURL=architect.js.map
|
|
@@ -10,11 +10,11 @@ export type ChatMessage = Record<string, unknown>;
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function ensurePatientDispatcher(): Promise<void>;
|
|
12
12
|
export declare function patientFetchInit(): Pick<RequestInit, 'dispatcher'>;
|
|
13
|
-
|
|
13
|
+
interface ChatCompletion {
|
|
14
14
|
message: Record<string, unknown>;
|
|
15
15
|
finishReason: unknown;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
interface ChatClientOptions {
|
|
18
18
|
endpoint: URL;
|
|
19
19
|
headers: Record<string, string>;
|
|
20
20
|
fetch: typeof globalThis.fetch;
|
|
@@ -80,4 +80,4 @@ export declare class ChatClient {
|
|
|
80
80
|
* non-streaming shape: `{ choices: [{ message, finish_reason }], usage }`.
|
|
81
81
|
*/
|
|
82
82
|
export declare function readCompletionResponse(response: Response): Promise<unknown>;
|
|
83
|
-
export
|
|
83
|
+
export {};
|
|
@@ -281,7 +281,7 @@ export async function readCompletionResponse(response) {
|
|
|
281
281
|
message.tool_calls = toolCalls;
|
|
282
282
|
return { choices: [{ message, finish_reason: finishReason ?? (toolCalls.length ? 'tool_calls' : 'stop') }], ...(usage ? { usage } : {}) };
|
|
283
283
|
}
|
|
284
|
-
|
|
284
|
+
async function readBoundedResponse(response) {
|
|
285
285
|
if (!response.body)
|
|
286
286
|
throw new Error('Missing response body');
|
|
287
287
|
const reader = response.body.getReader(), chunks = [];
|
|
@@ -304,4 +304,3 @@ export async function readBoundedResponse(response) {
|
|
|
304
304
|
}
|
|
305
305
|
return JSON.parse(Buffer.concat(chunks).toString('utf8'));
|
|
306
306
|
}
|
|
307
|
-
//# sourceMappingURL=chat-client.js.map
|
|
@@ -1,50 +1,7 @@
|
|
|
1
1
|
import type { ChatMessage } from './chat-client.js';
|
|
2
2
|
import { type AgentResult } from '../executor-types.js';
|
|
3
3
|
import { type CompactEnv } from './step.js';
|
|
4
|
-
|
|
5
|
-
export declare const DEFAULT_TASK_TOOL_BUDGET = 25;
|
|
6
|
-
export declare const TASK_RESULT_SCHEMA: {
|
|
7
|
-
type: string;
|
|
8
|
-
additionalProperties: boolean;
|
|
9
|
-
required: string[];
|
|
10
|
-
properties: {
|
|
11
|
-
summary: {
|
|
12
|
-
type: string;
|
|
13
|
-
};
|
|
14
|
-
files: {
|
|
15
|
-
type: string;
|
|
16
|
-
items: {
|
|
17
|
-
type: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
tests: {
|
|
21
|
-
type: string;
|
|
22
|
-
items: {
|
|
23
|
-
type: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
verification: {
|
|
27
|
-
type: string;
|
|
28
|
-
};
|
|
29
|
-
incomplete: {
|
|
30
|
-
type: string;
|
|
31
|
-
items: {
|
|
32
|
-
type: string;
|
|
33
|
-
additionalProperties: boolean;
|
|
34
|
-
required: string[];
|
|
35
|
-
properties: {
|
|
36
|
-
task: {
|
|
37
|
-
type: string;
|
|
38
|
-
};
|
|
39
|
-
reason: {
|
|
40
|
-
type: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
export interface TaskGroup {
|
|
4
|
+
interface TaskGroup {
|
|
48
5
|
index: number;
|
|
49
6
|
title: string;
|
|
50
7
|
tasks: {
|
|
@@ -66,9 +23,7 @@ export declare function namedFiles(task: string): string[];
|
|
|
66
23
|
* Generic Node/Jest/TS and Python signatures; anything else passes through.
|
|
67
24
|
*/
|
|
68
25
|
export declare function diagnoseVerificationFailure(feedback: string, roots: readonly string[]): string[];
|
|
69
|
-
|
|
70
|
-
export declare function repositoryInventory(roots: readonly string[], limit?: number): string[];
|
|
71
|
-
export interface LanguageProfile {
|
|
26
|
+
interface LanguageProfile {
|
|
72
27
|
primary: string;
|
|
73
28
|
others: string[];
|
|
74
29
|
}
|
|
@@ -95,8 +50,6 @@ export declare function duplicateSibling(roots: readonly string[], file: string,
|
|
|
95
50
|
* adding .tsx is fine).
|
|
96
51
|
*/
|
|
97
52
|
export declare function foreignLanguageFile(roots: readonly string[], file: string, languages: LanguageProfile): string | undefined;
|
|
98
|
-
/** Existing test directories (relative, POSIX) among the conventional names, e.g. `tests`, `test`, `__tests__`, `spec`. */
|
|
99
|
-
export declare function existingTestDirs(roots: readonly string[]): string[];
|
|
100
53
|
/**
|
|
101
54
|
* A NEW test file outside the directory the repository already keeps its
|
|
102
55
|
* tests in (`src/hold.test.js` next to an existing `tests/`): the reason to
|
|
@@ -112,8 +65,6 @@ export declare function misplacedTestFile(roots: readonly string[], file: string
|
|
|
112
65
|
export declare function siblingTestFile(roots: readonly string[], file: string): string | undefined;
|
|
113
66
|
/** The absolute path a task-named file resolves to: the exact path, else the same stem in a sibling extension of the same language family. */
|
|
114
67
|
export declare function locateNamedFile(roots: readonly string[], file: string): string | undefined;
|
|
115
|
-
/** Extra tool calls a correction group gets on top of the task budget: it must read AND patch, and the feedback is long. */
|
|
116
|
-
export declare const CORRECTION_BUDGET_BONUS = 10;
|
|
117
68
|
/**
|
|
118
69
|
* Source excerpts around every `file:line` the feedback names (Jest/Babel
|
|
119
70
|
* `path/file.js: … (30:56)`, TS `file.ts(12,3)` / `file.ts:12:3`, mocha
|
|
@@ -125,27 +76,8 @@ export declare function feedbackExcerpts(feedback: string, roots: readonly strin
|
|
|
125
76
|
context?: number;
|
|
126
77
|
maxBytes?: number;
|
|
127
78
|
}): string;
|
|
128
|
-
/** An existing file this long is edited with apply_patch, never regenerated whole (observed: a 1.4k-line test rewritten twice in one group, ~25 minutes of generation). */
|
|
129
|
-
export declare const REWRITE_MAX_LINES = 150;
|
|
130
|
-
/** Above this many lines, `read_file` answers with an outline (head + index of definitions) instead of the whole file. */
|
|
131
|
-
export declare const OUTLINE_MIN_LINES = 400;
|
|
132
|
-
/**
|
|
133
|
-
* A large file as an outline: the first lines (imports, top-level state) and
|
|
134
|
-
* an index of definitions with their line numbers, so the model asks for the
|
|
135
|
-
* range it needs with read_lines instead of putting 15k tokens of test file
|
|
136
|
-
* into the transcript on every read (observed: 4-minute prefills).
|
|
137
|
-
*/
|
|
138
|
-
export declare function outlineLargeFile(file: string, content: string): string | undefined;
|
|
139
|
-
/** Files a model writes to narrate its own work; never part of a task, always noise for the reviewer (observed: fix_summary.json, task-summary.json in the repository root). */
|
|
140
|
-
export declare const NARRATION_FILE: RegExp;
|
|
141
79
|
/** Media/binary extensions a text-only tool can never produce correctly. */
|
|
142
80
|
export declare const BINARY_ASSET: RegExp;
|
|
143
|
-
/** Extra write-only calls a task group gets when it spent its whole budget reading. */
|
|
144
|
-
export declare const WRITE_EXTENSION_CALLS = 6;
|
|
145
|
-
/** Tool calls the in-place fix round after a failed group check may spend. */
|
|
146
|
-
export declare const GROUP_FIX_BUDGET = 20;
|
|
147
|
-
/** Test files among `reported` that the repository's own test command (per root) does not execute; empty when no command is detected. */
|
|
148
|
-
export declare function unreachedGroupTests(roots: readonly string[], reported: readonly string[]): string[];
|
|
149
81
|
/** A source file that exists but carries no implementation: a handful of lines, a placeholder import, or only TODOs. */
|
|
150
82
|
export declare function isStubFile(file: string, minLines?: number): boolean;
|
|
151
83
|
/** Ticks the given task ids; every other byte of tasks.md is preserved, as the developer write rule requires. */
|
|
@@ -158,3 +90,4 @@ export declare function tickTasks(markdown: string, ids: Set<string>): string;
|
|
|
158
90
|
export declare function runCompactDeveloper(env: CompactEnv, options?: {
|
|
159
91
|
taskToolBudget?: number;
|
|
160
92
|
}): Promise<AgentResult>;
|
|
93
|
+
export {};
|