@fitlab-ai/agent-infra 0.11.6 → 0.11.8
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/dist/bin/internal-cli.js +8 -2
- package/dist/lib/agent-clients/adapters/codex.js +1 -1
- package/dist/lib/agent-clients/config.js +11 -3
- package/dist/lib/defaults.json +6 -3
- package/dist/lib/git/primary-worktree.js +58 -0
- package/dist/lib/internal/cli-route-inventory.js +3 -0
- package/dist/lib/internal/platform-pr-review.js +20 -3
- package/dist/lib/internal/task-operation-registry.js +3 -1
- package/dist/lib/internal/task-platform-recovery.js +56 -0
- package/dist/lib/merge.js +25 -5
- package/dist/lib/platform/completion-backfill.js +2 -1
- package/dist/lib/platform/in-label-sync.js +12 -1
- package/dist/lib/platform/issue-comments.js +58 -4
- package/dist/lib/platform/issues.js +105 -5
- package/dist/lib/platform/operation-coordinator.js +74 -0
- package/dist/lib/platform/pr-review.js +107 -1
- package/dist/lib/platform/pr-summary.js +79 -57
- package/dist/lib/platform/pull-requests.js +125 -7
- package/dist/lib/sandbox/commands/create.js +6 -3
- package/dist/lib/sandbox/commands/ls.js +4 -3
- package/dist/lib/sandbox/commands/rm.js +1 -1
- package/dist/lib/sandbox/config.js +22 -4
- package/dist/lib/sandbox/control/server.js +6 -2
- package/dist/lib/sandbox/git-metadata.js +50 -0
- package/dist/lib/sandbox/index.js +1 -1
- package/dist/lib/sandbox/mounts.js +12 -0
- package/dist/lib/sandbox/recovery.js +11 -0
- package/dist/lib/sandbox/removal.js +58 -20
- package/dist/lib/sandbox/tools.js +29 -7
- package/dist/lib/server/config.js +7 -27
- package/dist/lib/server/daemon.js +4 -3
- package/dist/lib/server/process-control.js +4 -2
- package/dist/lib/server/runner.js +4 -3
- package/dist/lib/task/activity-intent.js +4 -3
- package/dist/lib/task/artifact-lifecycle.js +42 -10
- package/dist/lib/task/artifact-receipts.js +62 -22
- package/dist/lib/task/capabilities.js +22 -4
- package/dist/lib/task/completion-facts.js +56 -0
- package/dist/lib/task/create-service.js +11 -5
- package/dist/lib/task/create.js +60 -79
- package/dist/lib/task/events.js +268 -195
- package/dist/lib/task/finalization-artifacts.js +4 -1
- package/dist/lib/task/finalization-handoff.js +2 -1
- package/dist/lib/task/finalization.js +157 -24
- package/dist/lib/task/invalidation-command.js +4 -2
- package/dist/lib/task/invalidation.js +38 -9
- package/dist/lib/task/lifecycle.js +38 -2
- package/dist/lib/task/local-artifact-finalization.js +17 -3
- package/dist/lib/task/platform-operation-journal.js +152 -0
- package/dist/lib/task/platform-operation-recovery.js +459 -0
- package/dist/lib/task/qualification-audit.js +23 -105
- package/dist/lib/task/review-finalization.js +7 -0
- package/dist/lib/task/review-identity.js +69 -0
- package/dist/lib/task/sections.js +6 -5
- package/dist/lib/task/task-execution-lock.js +6 -3
- package/dist/lib/task/verification-engine.js +14 -63
- package/dist/lib/task/verification.js +35 -38
- package/dist/lib/task/workflow-warning-intents.js +7 -1
- package/dist/lifecycle-build-manifest.json +3 -3
- package/lib/agent-clients/adapters/codex.ts +1 -1
- package/lib/agent-clients/config.ts +9 -3
- package/lib/defaults.json +6 -3
- package/lib/git/primary-worktree.ts +62 -0
- package/lib/internal/cli-route-inventory.ts +2 -0
- package/lib/internal/platform-pr-review.ts +14 -3
- package/lib/internal/task-operation-registry.ts +3 -1
- package/lib/internal/task-platform-recovery.ts +53 -0
- package/lib/merge.ts +26 -6
- package/lib/platform/completion-backfill.ts +2 -1
- package/lib/platform/in-label-sync.ts +12 -0
- package/lib/platform/issue-comments.ts +59 -3
- package/lib/platform/issues.ts +103 -5
- package/lib/platform/operation-coordinator.ts +96 -0
- package/lib/platform/pr-review.ts +113 -1
- package/lib/platform/pr-summary.ts +22 -1
- package/lib/platform/pull-requests.ts +132 -8
- package/lib/sandbox/commands/create.ts +7 -8
- package/lib/sandbox/commands/ls.ts +4 -3
- package/lib/sandbox/commands/rm.ts +1 -1
- package/lib/sandbox/config.ts +23 -5
- package/lib/sandbox/control/server.ts +5 -2
- package/lib/sandbox/git-metadata.ts +66 -0
- package/lib/sandbox/index.ts +1 -1
- package/lib/sandbox/mounts.ts +14 -0
- package/lib/sandbox/recovery.ts +13 -0
- package/lib/sandbox/removal.ts +57 -19
- package/lib/sandbox/tool-types.ts +1 -1
- package/lib/sandbox/tools.ts +36 -7
- package/lib/server/config.ts +7 -29
- package/lib/server/daemon.ts +5 -3
- package/lib/server/process-control.ts +4 -2
- package/lib/server/runner.ts +7 -4
- package/lib/server/server.schema.json +0 -4
- package/lib/task/activity-intent.ts +4 -3
- package/lib/task/artifact-lifecycle.ts +35 -11
- package/lib/task/artifact-receipts.ts +55 -15
- package/lib/task/capabilities.ts +17 -3
- package/lib/task/completion-facts.ts +66 -0
- package/lib/task/create-service.ts +12 -6
- package/lib/task/create.ts +54 -69
- package/lib/task/events.ts +248 -182
- package/lib/task/finalization-artifacts.ts +4 -1
- package/lib/task/finalization-handoff.ts +2 -1
- package/lib/task/finalization.ts +154 -21
- package/lib/task/invalidation-command.ts +4 -2
- package/lib/task/invalidation.ts +35 -10
- package/lib/task/lifecycle.ts +35 -3
- package/lib/task/local-artifact-finalization.ts +13 -3
- package/lib/task/platform-operation-journal.ts +230 -0
- package/lib/task/platform-operation-recovery.ts +435 -0
- package/lib/task/qualification-audit.ts +21 -114
- package/lib/task/review-finalization.ts +7 -0
- package/lib/task/review-identity.ts +85 -0
- package/lib/task/sections.ts +6 -6
- package/lib/task/task-execution-lock.ts +7 -3
- package/lib/task/verification-engine.ts +13 -86
- package/lib/task/verification.ts +34 -38
- package/lib/task/workflow-warning-intents.ts +9 -1
- package/package.json +1 -1
- package/templates/.agents/README.en.md +19 -17
- package/templates/.agents/README.zh-CN.md +18 -16
- package/templates/.agents/rules/README.en.md +2 -1
- package/templates/.agents/rules/README.zh-CN.md +2 -1
- package/templates/.agents/rules/decision-qualification.en.md +4 -3
- package/templates/.agents/rules/decision-qualification.zh-CN.md +4 -3
- package/templates/.agents/rules/task-management.en.md +12 -0
- package/templates/.agents/rules/task-management.zh-CN.md +12 -0
- package/templates/.agents/rules/validation-output.en.md +19 -0
- package/templates/.agents/rules/validation-output.zh-CN.md +19 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/block-task/SKILL.en.md +2 -0
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/cancel-task/SKILL.en.md +6 -2
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/code-task/SKILL.en.md +5 -3
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/code-task/reference/report-template.en.md +4 -8
- package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +4 -8
- package/templates/.agents/skills/commit/SKILL.en.md +1 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +1 -1
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.en.md +4 -0
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +4 -0
- package/templates/.agents/skills/create-pr/SKILL.en.md +2 -0
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/create-task/SKILL.en.md +2 -0
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-codescan/SKILL.en.md +2 -0
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +2 -0
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-issue/SKILL.en.md +2 -0
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/plan-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/plan-task/config/verify.en.json +1 -1
- package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +3 -1
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/review-analysis/reference/report-template.en.md +4 -8
- package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +4 -8
- package/templates/.agents/skills/review-code/SKILL.en.md +13 -12
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +11 -12
- package/templates/.agents/skills/review-code/config/verify.en.json +1 -3
- package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -3
- package/templates/.agents/skills/review-code/reference/output-templates.en.md +23 -46
- package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +27 -48
- package/templates/.agents/skills/review-code/reference/report-template.en.md +8 -11
- package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +8 -11
- package/templates/.agents/skills/review-code/reference/review-criteria.en.md +2 -2
- package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +2 -2
- package/templates/.agents/skills/review-plan/SKILL.en.md +3 -1
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/review-plan/reference/report-template.en.md +5 -9
- package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +5 -9
- package/templates/.agents/skills/review-pr/SKILL.en.md +13 -11
- package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +13 -11
- package/templates/.agents/skills/review-pr/reference/output-guidance.en.md +3 -3
- package/templates/.agents/skills/review-pr/reference/output-guidance.zh-CN.md +3 -3
- package/templates/.agents/skills/review-pr/reference/report-template.en.md +4 -0
- package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +4 -0
- package/templates/.agents/skills/run-manual-validation/SKILL.en.md +1 -1
- package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +19 -6
- package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -0
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +1 -1
- package/templates/.agents/templates/task.en.md +2 -2
- package/templates/.agents/templates/task.zh-CN.md +2 -2
package/lib/task/verification.ts
CHANGED
|
@@ -134,46 +134,42 @@ function statusLabel(status: unknown): string {
|
|
|
134
134
|
return status === 'fail' ? 'FAIL' : status === 'blocked' ? 'BLOCKED' : 'pass';
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
function renderPayload(payload: Record<string, unknown>): string {
|
|
138
|
-
const lines: string[] = [];
|
|
139
|
-
if (Array.isArray(payload.checks)) {
|
|
140
|
-
const gateMode = typeof payload.gate === 'string';
|
|
141
|
-
lines.push(gateMode
|
|
142
|
-
? `Verification: ${payload.gate} | Skill: ${payload.skill}`
|
|
143
|
-
: `Check: ${payload.status} | Skill: ${payload.skill} | Type: ${payload.type}`, '');
|
|
144
|
-
for (const check of payload.checks as Array<Record<string, unknown>>) {
|
|
145
|
-
const raw = statusLabel(check.status);
|
|
146
|
-
const effective = statusLabel(check.effectiveStatus ?? check.status);
|
|
147
|
-
const reason = check.reason ?? 'CHECK_FAILED';
|
|
148
|
-
const message = check.message ?? reason;
|
|
149
|
-
lines.push(` [${effective}] ${check.checkId ?? check.type} (${check.classification ?? 'hard'}; raw ${raw}; reason ${reason}) - ${message}; ${check.action ?? 'Review validation output'}`);
|
|
150
|
-
}
|
|
151
|
-
const summary = payload.summary ?? (() => {
|
|
152
|
-
const checks = payload.checks as Array<Record<string, unknown>>;
|
|
153
|
-
const statuses = checks.map((check) => check.effectiveStatus ?? check.status);
|
|
154
|
-
return `${statuses.filter((status) => status === 'pass').length} passed, ${statuses.filter((status) => status === 'fail').length} failed${statuses.includes('blocked') ? `, ${statuses.filter((status) => status === 'blocked').length} blocked` : ''}`;
|
|
155
|
-
})();
|
|
156
|
-
lines.push('', `Result: ${summary} - ${payload.action}`);
|
|
157
|
-
} else {
|
|
158
|
-
lines.push(`Check: ${payload.status} | Skill: ${payload.skill} | Type: ${payload.type}`, '');
|
|
159
|
-
const raw = statusLabel(payload.status);
|
|
160
|
-
const effective = statusLabel(payload.effectiveStatus ?? payload.status);
|
|
161
|
-
const reason = payload.reason ?? 'CHECK_FAILED';
|
|
162
|
-
lines.push(` [${effective}] ${payload.checkId ?? payload.type} (${payload.classification ?? 'hard'}; raw ${raw}; reason ${reason}) - ${payload.message ?? reason}; ${payload.action ?? 'Review validation output'}`);
|
|
163
|
-
const status = payload.effectiveStatus ?? payload.status;
|
|
164
|
-
const summary = status === 'pass' ? '1 passed, 0 failed'
|
|
165
|
-
: status === 'blocked' ? '0 passed, 0 failed, 1 blocked' : '0 passed, 1 failed';
|
|
166
|
-
const action = status === 'pass' ? 'Requested check passed'
|
|
167
|
-
: status === 'blocked' ? `Resolve blocked ${payload.type} check and re-run check`
|
|
168
|
-
: `Fix ${payload.type} issues and re-run check`;
|
|
169
|
-
lines.push('', `Result: ${summary} - ${action}`);
|
|
170
|
-
}
|
|
171
|
-
return `${lines.join('\n')}\n`;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
137
|
function renderTaskVerification(result: TaskVerificationResult): string {
|
|
175
138
|
if (result.status === 'failed') return `Verification failed: ${result.error?.code ?? 'VERIFY_FAILED'} - ${result.error?.message ?? 'unknown error'}\n`;
|
|
176
|
-
|
|
139
|
+
const target = `${result.event}${result.artifact ? ` (${result.artifact})` : ''}`;
|
|
140
|
+
const lines = [`Verification: ${result.status} | Target: ${target} | Skill: ${result.skill}`];
|
|
141
|
+
const checks = result.invocations.flatMap(({ payload }) => {
|
|
142
|
+
if (Array.isArray(payload.checks)) return payload.checks as Array<Record<string, unknown>>;
|
|
143
|
+
return [payload];
|
|
144
|
+
});
|
|
145
|
+
const counts = {
|
|
146
|
+
pass: checks.filter((check) => (check.effectiveStatus ?? check.status) === 'pass').length,
|
|
147
|
+
fail: checks.filter((check) => (check.effectiveStatus ?? check.status) === 'fail').length,
|
|
148
|
+
blocked: checks.filter((check) => (check.effectiveStatus ?? check.status) === 'blocked').length
|
|
149
|
+
};
|
|
150
|
+
const summary = `${counts.pass} passed, ${counts.fail} failed${counts.blocked > 0 ? `, ${counts.blocked} blocked` : ''}`;
|
|
151
|
+
lines.push('', `Result: ${summary}`);
|
|
152
|
+
|
|
153
|
+
for (const check of checks) {
|
|
154
|
+
const rawStatus = check.status;
|
|
155
|
+
const effectiveStatus = check.effectiveStatus ?? rawStatus;
|
|
156
|
+
const isSoftWarning = (rawStatus === 'fail' || rawStatus === 'blocked') && effectiveStatus === 'pass';
|
|
157
|
+
const reason = check.reason ?? 'CHECK_FAILED';
|
|
158
|
+
const message = check.message ?? reason;
|
|
159
|
+
const action = check.action ?? 'Review validation output';
|
|
160
|
+
const id = check.checkId ?? check.type;
|
|
161
|
+
const isHumanExemptionNotice = id === 'post-review-commit'
|
|
162
|
+
&& typeof message === 'string'
|
|
163
|
+
&& /\bhuman-decided (?:post-review )?exemption\b/i.test(message)
|
|
164
|
+
&& /\bPRC-\d+\s*:/.test(message);
|
|
165
|
+
if (effectiveStatus === 'pass' && !isSoftWarning && !isHumanExemptionNotice) continue;
|
|
166
|
+
lines.push(isSoftWarning
|
|
167
|
+
? `Warning: ${id} (${rawStatus === 'blocked' ? `raw BLOCKED; ` : ''}${reason}) - ${message}; ${action}`
|
|
168
|
+
: isHumanExemptionNotice
|
|
169
|
+
? `Notice: ${id} - ${message}; ${action}`
|
|
170
|
+
: ` [${statusLabel(effectiveStatus)}] ${id} (${reason}) - ${message}; ${action}`);
|
|
171
|
+
}
|
|
172
|
+
return `${lines.join('\n')}\n`;
|
|
177
173
|
}
|
|
178
174
|
|
|
179
175
|
export { VERIFICATION_CATALOG, renderTaskVerification, verifyTaskEvent };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
2
3
|
|
|
3
4
|
import { resolveTaskRef } from './resolve-ref.ts';
|
|
4
5
|
import { parseTaskFrontmatter } from './frontmatter.ts';
|
|
@@ -142,7 +143,14 @@ function projectFinalizationWarning(
|
|
|
142
143
|
if (!resolved.ok) return { status: 'failed', changed: false, error: { code: resolved.code, message: resolved.message } };
|
|
143
144
|
let prepared = resolved.state === 'completed';
|
|
144
145
|
if (!prepared && resolved.state === 'active') {
|
|
145
|
-
try {
|
|
146
|
+
try {
|
|
147
|
+
const taskContent = fs.readFileSync(resolved.taskMdPath, 'utf8');
|
|
148
|
+
prepared = parseTaskFrontmatter(taskContent).status === 'completed';
|
|
149
|
+
if (!prepared) {
|
|
150
|
+
const lifecycle = JSON.parse(fs.readFileSync(path.join(resolved.taskDir, '.task-lifecycle.json'), 'utf8')) as Record<string, unknown>;
|
|
151
|
+
prepared = lifecycle.taskId === resolved.taskId && lifecycle.intent === 'complete';
|
|
152
|
+
}
|
|
153
|
+
}
|
|
146
154
|
catch { prepared = false; }
|
|
147
155
|
}
|
|
148
156
|
if (!prepared) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fitlab-ai/agent-infra",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.8",
|
|
4
4
|
"description": "Bootstrap tool for AI multi-tool collaboration infrastructure — works with Claude Code, Codex, Antigravity CLI, and OpenCode",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -252,7 +252,7 @@ ai agent-client configure
|
|
|
252
252
|
|
|
253
253
|
TraeCode CLI uses `.agents/skills/` as the canonical Skill source. agent-infra generates lightweight slash-command wrappers under `.traecli/commands/`; each wrapper reads the corresponding shared Skill and forwards `$ARGUMENTS` when that Skill declares arguments. It does not mirror Skill packages into `.trae/skills/`, which remains user-owned for intentional Trae-specific overrides.
|
|
254
254
|
|
|
255
|
-
`agentClients` is the sole source of truth for built-in client state. The top-level array must contain all five built-in clients in the fixed canonical order; `sandbox.tools` lists
|
|
255
|
+
`agentClients` is the sole source of truth for built-in client state. The top-level array must contain all five built-in clients in the fixed canonical order; `sandbox.tools.ids` lists non-client tools such as `agent-infra` and custom tools, while `sandbox.tools.definitions` maps custom tool IDs to their definitions. A legacy `tuis` field or a built-in client id in `sandbox.tools.ids` is rejected, and configuration is never rewritten automatically.
|
|
256
256
|
|
|
257
257
|
### Side effects of disabling an Agent Client
|
|
258
258
|
|
|
@@ -260,7 +260,7 @@ When you disable a built-in client, reconciliation stops maintaining its seed co
|
|
|
260
260
|
|
|
261
261
|
### Relation to other config fields
|
|
262
262
|
|
|
263
|
-
- `sandbox.tools`
|
|
263
|
+
- `sandbox.tools.ids` lists non-client tools such as `agent-infra` and custom tools; custom definitions belong in `sandbox.tools.definitions`. Built-in client installation belongs in `agentClients[].installInSandbox`.
|
|
264
264
|
- `agentClients` is independent from `customTUIs` (see below). Custom TUI command files are preserved even when their directory is under a disabled built-in client's path prefix.
|
|
265
265
|
|
|
266
266
|
## Custom TUI Configuration
|
|
@@ -313,13 +313,13 @@ Namespaced custom TUI:
|
|
|
313
313
|
|
|
314
314
|
## Sandbox Custom Tools
|
|
315
315
|
|
|
316
|
-
`customTUIs` generates slash-command files but does not change the sandbox image. To install a non-npm CLI or tool (pip / cargo / curl-based / pre-built binary) into the sandbox image and live-mount its credentials, declare it under `sandbox.
|
|
316
|
+
`customTUIs` generates slash-command files but does not change the sandbox image. To install a non-npm CLI or tool (pip / cargo / curl-based / pre-built binary) into the sandbox image and live-mount its credentials, declare it under an ID key in `sandbox.tools.definitions` in `.agents/.airc.json`. Built-in Agent Clients are installed according to `agentClients[].installInSandbox`; `agent-infra` remains a non-client entry in `sandbox.tools.ids` and only provides the in-sandbox `ai` / `agent-infra` CLI.
|
|
317
317
|
|
|
318
318
|
### Required fields
|
|
319
319
|
|
|
320
320
|
| Field | Meaning |
|
|
321
321
|
|-------|---------|
|
|
322
|
-
|
|
|
322
|
+
| Definition object key | Lowercase tool ID matching `^[a-z0-9][a-z0-9-]*$`. Every selected custom tool in `sandbox.tools.ids` needs a matching definition. Definitions not listed in `ids` may remain unused. Keys must not collide with a built-in id. |
|
|
323
323
|
| `install` | Install descriptor. `{ "type": "npm", "cmd": "<npm package spec>" }` runs `npm install -g <cmd>`. `{ "type": "shell", "cmd": "<shell>" }` runs the shell command(s) as `devuser` during image build. `cmd` must be non-empty. |
|
|
324
324
|
|
|
325
325
|
Minimal entry — the contract for getting a tool into the image is just these two fields:
|
|
@@ -327,13 +327,14 @@ Minimal entry — the contract for getting a tool into the image is just these t
|
|
|
327
327
|
```json
|
|
328
328
|
{
|
|
329
329
|
"sandbox": {
|
|
330
|
-
"tools":
|
|
331
|
-
|
|
332
|
-
{
|
|
333
|
-
"
|
|
334
|
-
|
|
330
|
+
"tools": {
|
|
331
|
+
"ids": ["my-shell-tool"],
|
|
332
|
+
"definitions": {
|
|
333
|
+
"my-shell-tool": {
|
|
334
|
+
"install": { "type": "shell", "cmd": "curl -fsSL https://example.com/install.sh | bash" }
|
|
335
|
+
}
|
|
335
336
|
}
|
|
336
|
-
|
|
337
|
+
}
|
|
337
338
|
}
|
|
338
339
|
}
|
|
339
340
|
```
|
|
@@ -354,24 +355,25 @@ Add only the fields your tool actually needs. Omit them and the loader fills sen
|
|
|
354
355
|
| `hostLiveMounts` | (none) | Share host credentials live (e.g. OAuth tokens) with the container. Read-write. |
|
|
355
356
|
| `postSetupCmds` | (none) | Run commands inside the container after first setup (e.g. symlinks). |
|
|
356
357
|
|
|
357
|
-
> **`sandboxBase` is not user-configurable.** The loader always assigns `~/.agent-infra/sandboxes/<id>` so `ai sandbox rm` / `prune` can find tool state. Any `sandboxBase` value in
|
|
358
|
+
> **`sandboxBase` is not user-configurable.** The loader always assigns `~/.agent-infra/sandboxes/<id>` so `ai sandbox rm` / `prune` can find tool state. Any `sandboxBase` value in a definition is silently ignored.
|
|
358
359
|
|
|
359
360
|
Real-world example — `anthropic-claude` as a user-defined id with binary name `claude` and host credential live-mount:
|
|
360
361
|
|
|
361
362
|
```json
|
|
362
363
|
{
|
|
363
364
|
"sandbox": {
|
|
364
|
-
"tools":
|
|
365
|
-
|
|
366
|
-
{
|
|
367
|
-
"
|
|
365
|
+
"tools": {
|
|
366
|
+
"ids": ["anthropic-claude"],
|
|
367
|
+
"definitions": {
|
|
368
|
+
"anthropic-claude": {
|
|
368
369
|
"install": { "type": "npm", "cmd": "@anthropic-ai/claude-code@stable" },
|
|
369
370
|
"versionCmd": "claude --version",
|
|
370
371
|
"hostLiveMounts": [
|
|
371
372
|
{ "hostPath": "~/.claude/.credentials.json", "containerSubpath": ".credentials.json" }
|
|
372
373
|
]
|
|
374
|
+
}
|
|
373
375
|
}
|
|
374
|
-
|
|
376
|
+
}
|
|
375
377
|
}
|
|
376
378
|
}
|
|
377
379
|
```
|
|
@@ -386,7 +388,7 @@ Real-world example — `anthropic-claude` as a user-defined id with binary name
|
|
|
386
388
|
|
|
387
389
|
### Interaction with `sandbox.dockerfile`
|
|
388
390
|
|
|
389
|
-
When you set `sandbox.dockerfile` to point at your own Dockerfile, agent-infra still passes both `AI_TOOL_PACKAGES` (space-separated npm package specs) and `AI_TOOLS_SHELL_INSTALL_B64` (base64-encoded shell install script) as `--build-arg`. Your custom Dockerfile decides whether to consume them; if it does not declare the matching `ARG`, the shell installs
|
|
391
|
+
When you set `sandbox.dockerfile` to point at your own Dockerfile, agent-infra still passes both `AI_TOOL_PACKAGES` (space-separated npm package specs) and `AI_TOOLS_SHELL_INSTALL_B64` (base64-encoded shell install script) as `--build-arg`. Your custom Dockerfile decides whether to consume them; if it does not declare the matching `ARG`, the shell installs declared in `sandbox.tools.definitions` are silently skipped — taking over the Dockerfile means taking over the install path.
|
|
390
392
|
|
|
391
393
|
## Skill Authoring Conventions
|
|
392
394
|
|
|
@@ -250,7 +250,7 @@ ai agent-client configure
|
|
|
250
250
|
|
|
251
251
|
TraeCode CLI 以 `.agents/skills/` 作为 Skill 的唯一权威源。agent-infra 仅在 `.traecli/commands/` 下生成轻量 slash-command 包装文件;每个包装文件读取对应的共享 Skill,并在该 Skill 声明参数时转发 `$ARGUMENTS`。它不会把 Skill 包镜像到 `.trae/skills/`;该目录继续由用户所有,仅用于有意添加的 Trae 专属覆盖。
|
|
252
252
|
|
|
253
|
-
`agentClients` 是内建客户端状态的唯一配置来源。顶层数组必须按固定规范顺序包含全部五个内建客户端;`sandbox.tools`
|
|
253
|
+
`agentClients` 是内建客户端状态的唯一配置来源。顶层数组必须按固定规范顺序包含全部五个内建客户端;`sandbox.tools.ids` 按顺序列出 `agent-infra` 和自定义工具等非客户端工具,`sandbox.tools.definitions` 用工具 ID 键控自定义工具定义。旧 `tuis` 字段或 `sandbox.tools.ids` 中的内建客户端 id 会被拒绝,配置不会被自动改写。
|
|
254
254
|
|
|
255
255
|
### 取消 Agent Client 的副作用
|
|
256
256
|
|
|
@@ -258,7 +258,7 @@ TraeCode CLI 以 `.agents/skills/` 作为 Skill 的唯一权威源。agent-infra
|
|
|
258
258
|
|
|
259
259
|
### 与其他配置字段的关系
|
|
260
260
|
|
|
261
|
-
- `sandbox.tools`
|
|
261
|
+
- `sandbox.tools.ids` 只列出 `agent-infra` 和自定义工具等非客户端工具;自定义定义放在 `sandbox.tools.definitions`。内建客户端的安装状态由 `agentClients[].installInSandbox` 表达。
|
|
262
262
|
- `agentClients` 与 `customTUIs`(见下)相互独立。即使自定义 TUI 目录落在已取消的内建客户端路径前缀下,其命令文件也会被保留。
|
|
263
263
|
|
|
264
264
|
## 自定义 TUI 配置
|
|
@@ -311,13 +311,13 @@ TraeCode CLI 以 `.agents/skills/` 作为 Skill 的唯一权威源。agent-infra
|
|
|
311
311
|
|
|
312
312
|
## 沙箱自定义工具(Sandbox Custom Tools)
|
|
313
313
|
|
|
314
|
-
`customTUIs` 只负责生成 slash-command 文件,**不影响沙箱镜像**。如果要把一个非 npm 分发的 CLI 或工具(pip / cargo / curl 脚本 / 裸二进制)装进沙箱镜像、并 live-mount 它的凭证目录,需要在 `.agents/.airc.json` 的 `sandbox.
|
|
314
|
+
`customTUIs` 只负责生成 slash-command 文件,**不影响沙箱镜像**。如果要把一个非 npm 分发的 CLI 或工具(pip / cargo / curl 脚本 / 裸二进制)装进沙箱镜像、并 live-mount 它的凭证目录,需要在 `.agents/.airc.json` 的 `sandbox.tools.definitions` 中按工具 ID 声明。内建 Agent Client 按 `agentClients[].installInSandbox` 安装;`agent-infra` 仍是 `sandbox.tools.ids` 中的非客户端条目,只提供沙箱内的 `ai` / `agent-infra` CLI。
|
|
315
315
|
|
|
316
316
|
### 必填字段
|
|
317
317
|
|
|
318
318
|
| 字段 | 含义 |
|
|
319
319
|
|------|------|
|
|
320
|
-
|
|
|
320
|
+
| 定义对象的键 | 小写工具 ID,匹配 `^[a-z0-9][a-z0-9-]*$`;`ids` 中选用的自定义工具必须有对应定义;未列入 `ids` 的定义可以保留为未启用工具;不可与内建 id 冲突。 |
|
|
321
321
|
| `install` | 安装描述符。`{ "type": "npm", "cmd": "<npm 包规范>" }` 执行 `npm install -g <cmd>`;`{ "type": "shell", "cmd": "<shell>" }` 在镜像构建阶段以 `devuser` 执行 shell。`cmd` 必须非空。 |
|
|
322
322
|
|
|
323
323
|
最小入口——把一个工具装进镜像所需的契约只有这两个字段:
|
|
@@ -325,13 +325,14 @@ TraeCode CLI 以 `.agents/skills/` 作为 Skill 的唯一权威源。agent-infra
|
|
|
325
325
|
```json
|
|
326
326
|
{
|
|
327
327
|
"sandbox": {
|
|
328
|
-
"tools":
|
|
329
|
-
|
|
330
|
-
{
|
|
331
|
-
"
|
|
332
|
-
|
|
328
|
+
"tools": {
|
|
329
|
+
"ids": ["my-shell-tool"],
|
|
330
|
+
"definitions": {
|
|
331
|
+
"my-shell-tool": {
|
|
332
|
+
"install": { "type": "shell", "cmd": "curl -fsSL https://example.com/install.sh | bash" }
|
|
333
|
+
}
|
|
333
334
|
}
|
|
334
|
-
|
|
335
|
+
}
|
|
335
336
|
}
|
|
336
337
|
}
|
|
337
338
|
```
|
|
@@ -352,24 +353,25 @@ TraeCode CLI 以 `.agents/skills/` 作为 Skill 的唯一权威源。agent-infra
|
|
|
352
353
|
| `hostLiveMounts` | (无) | 把宿主凭证(如 OAuth token)实时挂进容器,读写共享。 |
|
|
353
354
|
| `postSetupCmds` | (无) | 首次安装完成后在容器内执行命令(如建符号链接)。 |
|
|
354
355
|
|
|
355
|
-
> **`sandboxBase` 不由用户配置。** loader 永远使用 `~/.agent-infra/sandboxes/<id>`,这样 `ai sandbox rm` / `prune`
|
|
356
|
+
> **`sandboxBase` 不由用户配置。** loader 永远使用 `~/.agent-infra/sandboxes/<id>`,这样 `ai sandbox rm` / `prune` 才能找到工具状态目录。定义对象里写的任何 `sandboxBase` 都会被静默忽略。
|
|
356
357
|
|
|
357
358
|
实际场景示例——`anthropic-claude` 作为用户自定义 id,二进制名是 `claude`,并把宿主凭证 live-mount 进来:
|
|
358
359
|
|
|
359
360
|
```json
|
|
360
361
|
{
|
|
361
362
|
"sandbox": {
|
|
362
|
-
"tools":
|
|
363
|
-
|
|
364
|
-
{
|
|
365
|
-
"
|
|
363
|
+
"tools": {
|
|
364
|
+
"ids": ["anthropic-claude"],
|
|
365
|
+
"definitions": {
|
|
366
|
+
"anthropic-claude": {
|
|
366
367
|
"install": { "type": "npm", "cmd": "@anthropic-ai/claude-code@stable" },
|
|
367
368
|
"versionCmd": "claude --version",
|
|
368
369
|
"hostLiveMounts": [
|
|
369
370
|
{ "hostPath": "~/.claude/.credentials.json", "containerSubpath": ".credentials.json" }
|
|
370
371
|
]
|
|
372
|
+
}
|
|
371
373
|
}
|
|
372
|
-
|
|
374
|
+
}
|
|
373
375
|
}
|
|
374
376
|
}
|
|
375
377
|
```
|
|
@@ -14,6 +14,7 @@ so you can quickly find "which ones to read" without opening each file.
|
|
|
14
14
|
- [`debugging-guide.md`](debugging-guide.md) — Structured debugging flow: gather evidence → form hypothesis → verify hypothesis → fix the root cause; no blind patch-and-retry.
|
|
15
15
|
- [`compatibility-policy.md`](compatibility-policy.md) — Compatibility by exception: admission evidence, implementation boundaries, exit conditions, and lifecycle review requirements.
|
|
16
16
|
- [`evidence-reporting.md`](evidence-reporting.md) — Minimum evidence semantics for state checks, successful summaries, exceptional results, identity fields, and sensitive data boundaries.
|
|
17
|
+
- [`validation-output.md`](validation-output.md) — User-facing validation summaries, failure diagnostics, soft warnings, and consumer boundaries.
|
|
17
18
|
- [`sync-content-generation.md`](sync-content-generation.md) — Producer-side Markdown constraints for task and lifecycle content synchronized to Issues.
|
|
18
19
|
- [`decision-qualification.md`](decision-qualification.md) — Constraint, candidate, human-confirmation, and six-artifact qualification-audit contract.
|
|
19
20
|
|
|
@@ -28,7 +29,7 @@ so you can quickly find "which ones to read" without opening each file.
|
|
|
28
29
|
|
|
29
30
|
## Task Workflow
|
|
30
31
|
|
|
31
|
-
- [`task-management.md`](task-management.md) — Task intent detection
|
|
32
|
+
- [`task-management.md`](task-management.md) — Task intent detection, workflow-command mapping, and skill blocking boundaries.
|
|
32
33
|
- [`lifecycle-orchestration.md`](lifecycle-orchestration.md) — Fresh executor/reviewer, one-use receipt, pause/recovery, and safe endpoint rules for `run-task`.
|
|
33
34
|
- [`review-handshake.md`](review-handshake.md) — Three-stage bidirectional review handshake: four-state disposition, symmetric evidence, disagreement ledger, convergence and post-review commit gate.
|
|
34
35
|
- [`review-method.md`](review-method.md) — Shared three-stage review method: multi-pass review, risk lenses, traceability, and finding evidence.
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
- [`debugging-guide.md`](debugging-guide.md) — 结构化调试流程:收集证据→形成假设→验证假设→修复根因,禁止盲目改代码重试。
|
|
14
14
|
- [`compatibility-policy.md`](compatibility-policy.md) — 兼容性默认关闭:准入证据、实现边界、退出条件与生命周期审查要求。
|
|
15
15
|
- [`evidence-reporting.md`](evidence-reporting.md) — 生命周期报告的状态核对、成功摘要、异常证据、身份字段和敏感信息边界。
|
|
16
|
+
- [`validation-output.md`](validation-output.md) — 面向用户的校验状态摘要、失败诊断、软警告及消费边界。
|
|
16
17
|
- [`sync-content-generation.md`](sync-content-generation.md) — 同步到 Issue 的任务和生命周期 Markdown 生成约束。
|
|
17
18
|
- [`decision-qualification.md`](decision-qualification.md) — 约束、候选、人工确认和六类 artifact 资格审计契约。
|
|
18
19
|
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
|
|
28
29
|
## 任务工作流
|
|
29
30
|
|
|
30
|
-
- [`task-management.md`](task-management.md) —
|
|
31
|
+
- [`task-management.md`](task-management.md) — 任务语义识别、工作流命令映射与技能阻塞边界。
|
|
31
32
|
- [`lifecycle-orchestration.md`](lifecycle-orchestration.md) — `run-task` 的 fresh executor/reviewer、一次性 receipt、暂停恢复与安全终点规则。
|
|
32
33
|
- [`review-handshake.md`](review-handshake.md) — 三阶段双向审查握手协议:四态处置、对称证据、分歧账本、收敛与 post-review commit 门禁。
|
|
33
34
|
- [`review-method.md`](review-method.md) — 三阶段共享检视方法:多遍检视、风险镜头、追踪与 finding 证据契约。
|
|
@@ -6,7 +6,8 @@ Any analysis, plan, implementation, or review that decides whether a human decis
|
|
|
6
6
|
|
|
7
7
|
- The `### Constraints` and `### Candidate and Rejected Options` tables in `task.md` are the only constraint and candidate fact source.
|
|
8
8
|
- The constraint table uses `constraint_id`, `statement`, `status`, `authority`, `source`, `evidence`, `derived_from`, and `approval_evidence`; the candidate table uses `candidate_id`, `statement`, `status`, `constraint_ids`, `impact`, and `evidence`.
|
|
9
|
-
-
|
|
9
|
+
- Qualification audits are optional in all six lifecycle artifact families. When `## Qualification Audit` is present, it must contain three decision tables (constraint dependencies, candidate qualification, classification results) and one snapshot row (`task_input_digest`, `non_constraint_input_digest`). Candidate qualification must cover the complete candidate set in the task.
|
|
10
|
+
- Lifecycle input relationships belong in the `Artifact Lifecycle Receipts` section of `task.md`. Freeze each stage's actual artifact inputs and SHA-256 values at stage start, then verify and record each input edge at completion. Do not duplicate lifecycle edges in qualification audits.
|
|
10
11
|
|
|
11
12
|
## Status and confirmation
|
|
12
13
|
|
|
@@ -17,6 +18,6 @@ Any analysis, plan, implementation, or review that decides whether a human decis
|
|
|
17
18
|
|
|
18
19
|
## Invalidation and review
|
|
19
20
|
|
|
20
|
-
When a
|
|
21
|
+
When a lifecycle artifact is replaced, start from the old artifact and follow verified input edges in the task receipts to find and invalidate every downstream consumer. Exclude the new artifact from the old graph. If any relation is missing, identity or SHA-256 does not match, or the graph cannot be verified, use the existing static downstream invalidation scope.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
When a qualification audit is present, missing or unknown references and digest mismatches block finalization. Audits in the old format with an upstream-relations table must be regenerated in the current format. Formatting-only changes must not change semantic digests; changes to meaning, provenance, status, or candidates require a new audit.
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
- `task.md` 的 `### 约束` 和 `### 候选与否决方案` 是唯一约束/候选事实源。
|
|
8
8
|
- 约束表必须使用 `constraint_id`、`statement`、`status`、`authority`、`source`、`evidence`、`derived_from`、`approval_evidence`;候选表必须使用 `candidate_id`、`statement`、`status`、`constraint_ids`、`impact`、`evidence`。
|
|
9
|
-
-
|
|
9
|
+
- 六类阶段产物可以省略资格审计。若填写 `## 资格审计`,必须包含约束依赖、候选资格、分类结果三张决策表,以及一行资格快照(`task_input_digest`、`non_constraint_input_digest`)。候选资格必须覆盖任务中的完整候选集合。
|
|
10
|
+
- 生命周期输入关系由 `task.md` 的“产物生命周期收据”记录;阶段开始时冻结实际输入 artifact 和 SHA-256,完成时验证后写入每条输入边。不要在资格审计中复制生命周期关系。
|
|
10
11
|
|
|
11
12
|
## 状态与确认
|
|
12
13
|
|
|
@@ -17,6 +18,6 @@
|
|
|
17
18
|
|
|
18
19
|
## 失效与审查
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
替换某个阶段产物时,系统从被替换的旧 artifact 出发,沿任务收据中验证过的输入边计算所有下游消费者,并使旧消费者失效;新产物不进入旧图。若任一关系缺失、身份不匹配、SHA-256 不匹配或图无法验证,则使用既有静态下游失效范围。
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
资格审计存在时,缺失、未知引用或 digest 不匹配都必须拒绝收尾。旧版包含“上游关系”表的资格审计不再读取,应按当前格式重新生成。排版变化不应改变语义 digest;语义、来源、状态或候选变化必须触发重新审计。
|
|
@@ -36,6 +36,18 @@ The seven internal commands (`task-event` / `task-lifecycle` / `task-finalizatio
|
|
|
36
36
|
- `task-verify` executes the typed catalog/check registry in-process; skills declare business events only.
|
|
37
37
|
- Both entrypoints are read-only. Verification exits remain `0=pass`, `1=fail`, and `2=blocked`; network or platform blocking must never be downgraded to success.
|
|
38
38
|
|
|
39
|
+
## Platform Results and Skill Blocking Boundaries
|
|
40
|
+
|
|
41
|
+
A `blocked` platform write means only that the operation is unfinished. Whether the skill stops depends on its delivery goal. The typed core handles write queuing, recovery, and idempotency; skills consume structured results and do not replay writes themselves.
|
|
42
|
+
|
|
43
|
+
- `import-issue`: stop importing when the source Issue cannot be read.
|
|
44
|
+
- `create-pr`: stop the creation flow when the PR was not created or its identity cannot be confirmed.
|
|
45
|
+
- `review-pr`: stop reviewing when the PR or reviewed head cannot be read. After local review is complete, record recoverable comment or formal Review write failures as the skill specifies without blocking the completed local review.
|
|
46
|
+
- `cancel-task`: apply the skill's full cancellation criteria; do not claim full cancellation when required Issue synchronization fails.
|
|
47
|
+
- `complete-task`: apply the skill's full completion criteria; resolve pending recoverable operations before archiving and do not claim completion while required remote facts remain unconfirmed.
|
|
48
|
+
|
|
49
|
+
Other skills continue past deferrable writes according to their local delivery goals. If `create-task` has created the local task but creation of the associated Issue fails, retain the local task and record the failure so independent subsequent work can continue.
|
|
50
|
+
|
|
39
51
|
## Required State Updates by Command
|
|
40
52
|
|
|
41
53
|
- `create-task`: create `branch`, `workflow`, `status`, `created_at`, `updated_at`, `assigned_to`, `agent_infra_version`
|
|
@@ -36,6 +36,18 @@
|
|
|
36
36
|
- `task-verify` 在进程内执行 typed catalog/check registry;SKILL 只声明业务事件,不传 task-dir、skill 名或特殊 check 序列。
|
|
37
37
|
- 两个入口均保持只读;验证退出码固定为 `0=pass`、`1=fail`、`2=blocked`,网络或平台阻塞不得降格为成功。
|
|
38
38
|
|
|
39
|
+
## 平台结果与技能阻塞边界
|
|
40
|
+
|
|
41
|
+
平台写入返回 `blocked` 只表示该操作尚未完成;技能是否停止由当前技能的交付目标决定。平台写入的排队、恢复和幂等由 typed core 执行,技能只消费结构化结果,不自行重放。
|
|
42
|
+
|
|
43
|
+
- `import-issue`:源 Issue 读取失败时停止导入。
|
|
44
|
+
- `create-pr`:PR 未创建或无法确认其身份时停止创建流程。
|
|
45
|
+
- `review-pr`:PR 或被审 head 无法读取时停止审查;本地审查完成后,评论或正式 Review 写入失败按技能记录待恢复事实,不阻断已完成的本地审查。
|
|
46
|
+
- `cancel-task`:按技能的完整取消标准判断;必要的 Issue 同步失败时不得宣称取消全部完成。
|
|
47
|
+
- `complete-task`:按技能的完整完成标准判断;归档前收敛待恢复操作,必要的远端事实未确认时不得宣称任务完成。
|
|
48
|
+
|
|
49
|
+
其他技能按各自的本地交付目标继续处理可延后写入。`create-task` 已在本地创建任务、但伴生 Issue 创建失败时,保留本地任务并记录失败,不停止后续可独立执行的工作。
|
|
50
|
+
|
|
39
51
|
## 常见命令的状态更新要求
|
|
40
52
|
|
|
41
53
|
- `create-task`:创建 `branch`、`workflow`、`status`、`created_at`、`updated_at`、`assigned_to`、`agent_infra_version`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Validation Output Summary
|
|
2
|
+
|
|
3
|
+
This rule governs how `task-verify --format text` and lifecycle skills present validation results to users. It does not change validation logic, structured results, or persisted evidence requirements.
|
|
4
|
+
|
|
5
|
+
## Overall Summary
|
|
6
|
+
|
|
7
|
+
- Show the overall status, validation target, and pass, fail, and blocked counts.
|
|
8
|
+
- For successful results, show only the summary; do not list passing check names.
|
|
9
|
+
- Keep failure and blocked states distinct. List only effective failed or blocked checks, with a stable identifier, concise reason, and actionable step.
|
|
10
|
+
- A soft check whose raw status is failed but effective status is pass must not count as a failure. When a user-facing notice is needed, show a concise warning with the necessary reason and action.
|
|
11
|
+
- A soft check whose raw status is blocked but effective status is pass must also show a concise warning that preserves the raw blocked state, necessary reason, and action.
|
|
12
|
+
- If a passing result carries a consumed human exemption or other required exception evidence, show a concise notice that preserves the exception evidence; continue to count the check by its effective status.
|
|
13
|
+
|
|
14
|
+
## Consumer Boundaries
|
|
15
|
+
|
|
16
|
+
- Do not copy complete successful stdout into the final response. Read structured details or rerun the command when passing check details are needed.
|
|
17
|
+
- Consume structured host finalization results through their status, receipt, and warning projection; do not present receipt contents as the user summary.
|
|
18
|
+
- Persisted lifecycle reports continue to follow `evidence-reporting.md`, recording reproducible scope, status, and necessary evidence. Issue artifact comments continue to sync the required report content.
|
|
19
|
+
- JSON payloads, check order, check set, effective-status decisions, and exit codes remain unchanged.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# 校验输出摘要规则
|
|
2
|
+
|
|
3
|
+
本规则约束 `task-verify --format text` 及生命周期技能向用户展示校验结果的方式。它不改变校验逻辑、结构化结果或持久化证据要求。
|
|
4
|
+
|
|
5
|
+
## 总体摘要
|
|
6
|
+
|
|
7
|
+
- 展示总体状态、校验目标,以及通过、失败和阻塞计数。
|
|
8
|
+
- 成功结果只展示摘要,不列出通过项名称。
|
|
9
|
+
- 失败与阻塞保持不同状态;只列出有效失败或阻塞项的稳定标识、简明原因和可执行动作。
|
|
10
|
+
- raw 状态失败但 effective 状态通过的软检查,不得计入失败;需要提醒用户时用简短警告及必要原因和动作说明。
|
|
11
|
+
- raw 状态阻塞但 effective 状态通过的软检查,也必须显示简短警告,并保留 raw 阻塞状态、必要原因和动作说明。
|
|
12
|
+
- 通过结果若包含已消费的人工作出豁免或其他必须保留的例外证据,应显示简短提示并保留例外证据;该检查仍按 effective 状态计数。
|
|
13
|
+
|
|
14
|
+
## 消费边界
|
|
15
|
+
|
|
16
|
+
- 不把完整成功 stdout 复制到最终回复。需要检查通过项明细时,按需读取结构化结果或重新运行命令。
|
|
17
|
+
- 宿主 finalization 等结构化结果按其状态、receipt 和 warning projection 消费;不要将 receipt 原文当作用户摘要。
|
|
18
|
+
- 持久化生命周期报告继续遵循 `evidence-reporting.md`,记录可复现范围、状态和必要证据;Issue artifact 评论继续同步所需报告内容。
|
|
19
|
+
- JSON payload、检查顺序、检查集合、effective status 判定和退出码均不受本规则影响。
|
|
@@ -21,7 +21,7 @@ The analysis artifact must record `Path`, `Basis`, `Unmet Higher-path Conditions
|
|
|
21
21
|
|
|
22
22
|
Before generating the analysis report, read `.agents/rules/evidence-reporting.md`. Record the command, target scope, status or structured result, actual result, and uncovered parts for state checks and successful checks; include decisive raw excerpts only for failures, blocking conditions, or disputes.
|
|
23
23
|
|
|
24
|
-
- When evaluating candidate qualification or `HD-N`, read `.agents/rules/decision-qualification.md`, audit normalized task constraints/candidates, and record the
|
|
24
|
+
- When evaluating candidate qualification or `HD-N`, read `.agents/rules/decision-qualification.md`, audit normalized task constraints/candidates, and record the three qualification-audit decision tables and snapshot in the analysis artifact; unknown or unconfirmed constraints must not automatically exclude a candidate
|
|
25
25
|
- This skill only outputs a requirements analysis document (`analysis.md` or `analysis-r{N}.md`) and does not modify any business code
|
|
26
26
|
- Base the analysis strictly on the existing task input, requirements, context, and source information in `task.md`
|
|
27
27
|
- Before generating task or lifecycle Markdown that will be synchronized to an Issue, read `.agents/rules/sync-content-generation.md` and apply its producer-side constraints; the sync path does not parse or rewrite the body
|
|
@@ -258,6 +258,8 @@ Run the verification gate to confirm the task artifact and sync state are valid:
|
|
|
258
258
|
agent-infra-internal task-verify {task-id} analyze.completed --artifact {analysis-artifact} --format text
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
+
Present the verification summary per `.agents/rules/validation-output.md`, retaining necessary failure, blocked, and soft-warning diagnostics.
|
|
262
|
+
|
|
261
263
|
Handle the result as follows:
|
|
262
264
|
- exit code 0 (all checks passed) -> continue to the "Inform User" step
|
|
263
265
|
- exit code 1 (validation failed) -> fix the reported issues and run the gate again
|
|
@@ -21,7 +21,7 @@ description: >
|
|
|
21
21
|
|
|
22
22
|
生成分析报告时,先读取 `.agents/rules/evidence-reporting.md`。状态核对和成功检查记录命令、目标范围、状态/结构化结果、实际结果和未覆盖部分;失败、阻塞或争议才附决定性原文摘录。
|
|
23
23
|
|
|
24
|
-
- 涉及候选资格或 `HD-N` 判断时,先读取 `.agents/rules/decision-qualification.md`,基于 task.md
|
|
24
|
+
- 涉及候选资格或 `HD-N` 判断时,先读取 `.agents/rules/decision-qualification.md`,基于 task.md 规范化约束/候选完成资格审计,并在分析产物记录三张资格审计决策表和资格快照;不得把来源不明或未确认约束自动升级为排除条件
|
|
25
25
|
- 本技能仅产出需求分析文档(`analysis.md` 或 `analysis-r{N}.md`)—— 不修改任何业务代码
|
|
26
26
|
- 严格基于 `task.md` 中已有的任务输入、需求、上下文和来源信息展开分析
|
|
27
27
|
- 生成会同步到 Issue 的任务或生命周期 Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;同步端不解析或改写正文
|
|
@@ -201,7 +201,7 @@ agent-infra-internal task-artifact {task-id} init --family analysis --artifact {
|
|
|
201
201
|
|
|
202
202
|
## 资格审计
|
|
203
203
|
|
|
204
|
-
>
|
|
204
|
+
> 仅当本阶段实际判断候选资格、约束依赖或人工裁决资格时填写本节,并按 `.agents/rules/decision-qualification.md` 完整记录三张决策表和资格快照;否则删除整个审计段。
|
|
205
205
|
|
|
206
206
|
## 假设
|
|
207
207
|
|
|
@@ -263,7 +263,7 @@ agent-infra-internal task-verify {task-id} analyze.completed --artifact {analysi
|
|
|
263
263
|
- 退出码 1(校验失败)-> 根据输出修复问题后重新运行校验
|
|
264
264
|
- 退出码 2(网络中断)-> 停止执行并告知用户需要人工介入
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
按 `.agents/rules/validation-output.md` 展示当次校验摘要;没有当次校验输出,不得声明完成。
|
|
267
267
|
|
|
268
268
|
### 9. 告知用户
|
|
269
269
|
|
|
@@ -86,6 +86,8 @@ Run the verification gate to confirm the task artifact and sync state are valid:
|
|
|
86
86
|
agent-infra-internal task-verify {task-id} block-task.completed --format text
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
Present the verification summary per `.agents/rules/validation-output.md`, retaining necessary failure, blocked, and soft-warning diagnostics.
|
|
90
|
+
|
|
89
91
|
Handle the result as follows:
|
|
90
92
|
- exit code 0 (all checks passed) -> continue to the "Inform User" step
|
|
91
93
|
- exit code 1 (validation failed) -> fix the reported issues and run the gate again
|
|
@@ -92,7 +92,7 @@ agent-infra-internal task-verify {task-id} block-task.completed --format text
|
|
|
92
92
|
- 退出码 1(校验失败)-> 根据输出修复问题后重新运行校验
|
|
93
93
|
- 退出码 2(网络中断)-> 停止执行并告知用户需要人工介入
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
按 `.agents/rules/validation-output.md` 展示当次校验摘要;没有当次校验输出,不得声明完成。
|
|
96
96
|
|
|
97
97
|
### 8. 告知用户
|
|
98
98
|
|
|
@@ -39,11 +39,13 @@ Check these directories in order:
|
|
|
39
39
|
|
|
40
40
|
Handling rules:
|
|
41
41
|
- If found in `active/` or `blocked/`: continue
|
|
42
|
-
- If found only in `completed
|
|
42
|
+
- If found only in `completed/` with valid `cancelled_at` and `cancel_reason`, reuse the recorded reason, skip Steps 3-5, and continue at Step 6 to recover Issue closure and comments; stop for other completed tasks
|
|
43
43
|
- If not found anywhere: prompt `Task {task-id} not found`
|
|
44
44
|
|
|
45
45
|
### 2. Choose the Cancellation Label
|
|
46
46
|
|
|
47
|
+
When retrying a completed task, use only the `cancel_reason` already recorded in `task.md`; do not replace it with new input.
|
|
48
|
+
|
|
47
49
|
Infer the Issue closing label from the cancellation reason:
|
|
48
50
|
- `status: superseded`: reason implies duplicate, replaced, merged into, or already covered by another Issue or PR
|
|
49
51
|
- `status: invalid`: reason implies invalid report, no real problem, cannot reproduce, or no issue after investigation
|
|
@@ -76,7 +78,7 @@ Confirm the task directory was moved successfully.
|
|
|
76
78
|
|
|
77
79
|
Check whether `task.md` contains a valid `platform_issue_identity`. If not, skip this step.
|
|
78
80
|
|
|
79
|
-
If a valid `platform_issue_identity` exists:
|
|
81
|
+
If a valid `platform_issue_identity` exists, require `applied` / `no-op` without an error for every operation before declaring cancellation fully complete. On failure, retain the local terminal state and recovery record, then retry this skill for the same task after repair:
|
|
80
82
|
- Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status {reason} --in-labels none --assignees none --milestone none --state closed --close-reason not_planned`
|
|
81
83
|
- Write the cancellation body to a temporary file and run `agent-infra-internal platform-comment sync {task-id} --kind cancel --body-file {path} --agent {standard-agent-token}`
|
|
82
84
|
- Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
|
|
@@ -93,6 +95,8 @@ Run the verification gate to confirm the moved task and sync state are valid:
|
|
|
93
95
|
agent-infra-internal task-verify {task-id} cancel-task.completed --format text
|
|
94
96
|
```
|
|
95
97
|
|
|
98
|
+
Present the verification summary per `.agents/rules/validation-output.md`, retaining necessary failure, blocked, and soft-warning diagnostics.
|
|
99
|
+
|
|
96
100
|
Handle the result as follows:
|
|
97
101
|
- exit code 0 (all checks passed) -> continue to the "Inform User" step
|
|
98
102
|
- exit code 1 (validation failed) -> fix the reported issues and run the gate again
|
|
@@ -38,11 +38,13 @@ description: >
|
|
|
38
38
|
|
|
39
39
|
处理规则:
|
|
40
40
|
- 如果在 `active/` 或 `blocked/` 中找到:继续
|
|
41
|
-
- 如果只在 `completed/`
|
|
41
|
+
- 如果只在 `completed/` 中找到且 `cancelled_at` 与 `cancel_reason` 有效:复用已记录的取消原因,跳过步骤 3-5,继续步骤 6 补齐 Issue 关闭与评论;其他 completed 任务停止
|
|
42
42
|
- 如果都不存在:提示 `Task {task-id} not found`
|
|
43
43
|
|
|
44
44
|
### 2. 判断取消标签
|
|
45
45
|
|
|
46
|
+
从 completed 任务重试时,只使用 `task.md` 已记录的 `cancel_reason`,不得采用本次输入改写取消原因。
|
|
47
|
+
|
|
46
48
|
根据取消原因推断 Issue 关闭标签:
|
|
47
49
|
- `status: superseded`:原因包含“重复”、“替代”、“合并到”、“已由 #123 / PR 替代”等语义
|
|
48
50
|
- `status: invalid`:原因包含“误报”、“不存在”、“无法复现”、“排查后无问题”等语义
|
|
@@ -75,7 +77,7 @@ ls .agents/workspace/completed/{task-id}/task.md
|
|
|
75
77
|
|
|
76
78
|
检查 `task.md` 中是否存在有效的 `platform_issue_identity`。如果没有,跳过此步骤。
|
|
77
79
|
|
|
78
|
-
如果存在有效的 `platform_issue_identity
|
|
80
|
+
如果存在有效的 `platform_issue_identity`,以下操作均须取得 `applied` / `no-op` 且无错误后才能宣称取消全部完成;失败时保留本地终态和待恢复记录,修复后以同一任务重试本技能:
|
|
79
81
|
- 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status {reason} --in-labels none --assignees none --milestone none --state closed --close-reason not_planned`
|
|
80
82
|
- 将取消正文写入临时文件,调用 `agent-infra-internal platform-comment sync {task-id} --kind cancel --body-file {path} --agent {standard-agent-token}`
|
|
81
83
|
- 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
|
|
@@ -97,7 +99,7 @@ agent-infra-internal task-verify {task-id} cancel-task.completed --format text
|
|
|
97
99
|
- 退出码 1(校验失败)-> 根据输出修复问题后重新运行校验
|
|
98
100
|
- 退出码 2(网络中断)-> 停止执行并告知用户需要人工介入
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
按 `.agents/rules/validation-output.md` 展示当次校验摘要;没有当次校验输出,不得声明完成。
|
|
101
103
|
|
|
102
104
|
### 8. 告知用户
|
|
103
105
|
|