@fitlab-ai/agent-infra 0.9.10 → 0.9.11
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 +13 -3
- package/README.zh-CN.md +13 -3
- package/bin/cli.ts +17 -4
- package/dist/bin/cli.js +19 -4
- package/dist/bin/internal-cli.js +50 -4
- package/dist/lib/agent-client.js +0 -1
- package/dist/lib/agent-clients/adapters/opencode-sandbox.js +0 -4
- package/dist/lib/agent-clients/adapters/traecli.js +7 -8
- package/dist/lib/agent-clients/config.js +14 -99
- package/dist/lib/agent-clients/reconcile.js +1 -11
- package/dist/lib/agent-clients/schema.js +5 -4
- package/dist/lib/agent-clients/tokens.js +5 -15
- package/dist/lib/decide.js +14 -30
- package/dist/lib/defaults.json +4 -0
- package/dist/lib/init.js +2 -2
- package/dist/lib/internal/release-workflow.js +0 -1
- package/dist/lib/internal/task-finalization.js +19 -9
- package/dist/lib/internal/task-ledger.js +8 -2
- package/dist/lib/internal/task-lifecycle.js +17 -93
- package/dist/lib/internal/task-orchestration.js +30 -216
- package/dist/lib/internal/task-validate.js +2 -1
- package/dist/lib/merge.js +205 -103
- package/dist/lib/process-data/normalize.js +2 -9
- package/dist/lib/run/host.js +46 -16
- package/dist/lib/sandbox/agent-client-reconciler.js +4 -12
- package/dist/lib/sandbox/commands/create.js +3 -3
- package/dist/lib/sandbox/commands/enter.js +18 -4
- package/dist/lib/sandbox/config.js +3 -12
- package/dist/lib/sandbox/control/executor.js +131 -39
- package/dist/lib/sandbox/control/lifecycle.js +29 -20
- package/dist/lib/sandbox/control/server.js +18 -16
- package/dist/lib/sandbox/mounts.js +3 -2
- package/dist/lib/sandbox/recovery.js +123 -22
- package/dist/lib/sandbox/workspace-identity.js +14 -0
- package/dist/lib/sandbox/workspace-view.js +8 -9
- package/dist/lib/self-update.js +278 -0
- package/dist/lib/server/protocol.js +5 -5
- package/dist/lib/task/activity-log.js +4 -1
- package/dist/lib/task/artifact-lifecycle.js +4 -2
- package/dist/lib/task/codex-orchestration.js +1 -1
- package/dist/lib/task/command-options.js +1 -3
- package/dist/lib/task/commands/cat.js +0 -5
- package/dist/lib/task/commands/decisions.js +76 -92
- package/dist/lib/task/commands/files.js +6 -6
- package/dist/lib/task/commands/grep.js +25 -61
- package/dist/lib/task/commands/issue-body.js +6 -6
- package/dist/lib/task/commands/log.js +25 -10
- package/dist/lib/task/commands/show.js +5 -6
- package/dist/lib/task/commands/status.js +8 -8
- package/dist/lib/task/commit-operation.js +21 -25
- package/dist/lib/task/commit-policy.js +1 -1
- package/dist/lib/task/control-authority.js +431 -0
- package/dist/lib/task/create.js +6 -1
- package/dist/lib/task/current-contract.js +35 -0
- package/dist/lib/task/decision-details.js +263 -0
- package/dist/lib/task/decision-intents.js +5 -2
- package/dist/lib/task/events.js +11 -5
- package/dist/lib/task/index.js +19 -20
- package/dist/lib/task/ledger-intents.js +8 -9
- package/dist/lib/task/ledger.js +13 -6
- package/dist/lib/task/lifecycle.js +16 -0
- package/dist/lib/task/orchestration.js +50 -13
- package/dist/lib/task/review-artifacts.js +31 -12
- package/dist/lib/task/review-finalization.js +19 -6
- package/dist/lib/task/verification-engine.js +38 -15
- package/dist/lib/task/verification-review.js +1 -1
- package/dist/lib/task/workspace-snapshot.js +5 -11
- package/dist/lib/task/write.js +11 -1
- package/dist/lib/update.js +6 -37
- package/dist/lib/version.js +5 -1
- package/dist/lifecycle-build-manifest.json +3 -3
- package/lib/agent-client.ts +0 -1
- package/lib/agent-clients/adapters/opencode-sandbox.ts +0 -5
- package/lib/agent-clients/adapters/traecli.ts +7 -8
- package/lib/agent-clients/config.ts +14 -144
- package/lib/agent-clients/reconcile.ts +1 -12
- package/lib/agent-clients/schema.ts +5 -4
- package/lib/agent-clients/tokens.ts +5 -18
- package/lib/decide.ts +12 -22
- package/lib/defaults.json +4 -0
- package/lib/init.ts +2 -2
- package/lib/internal/release-workflow.ts +0 -1
- package/lib/internal/task-finalization.ts +27 -13
- package/lib/internal/task-ledger.ts +8 -2
- package/lib/internal/task-lifecycle.ts +33 -76
- package/lib/internal/task-orchestration.ts +33 -190
- package/lib/internal/task-validate.ts +3 -2
- package/lib/merge.ts +236 -120
- package/lib/process-data/normalize.ts +2 -8
- package/lib/run/host.ts +63 -14
- package/lib/sandbox/agent-client-reconciler.ts +5 -15
- package/lib/sandbox/commands/create.ts +4 -4
- package/lib/sandbox/commands/enter.ts +24 -4
- package/lib/sandbox/config.ts +2 -14
- package/lib/sandbox/control/container-identity.ts +2 -2
- package/lib/sandbox/control/executor.ts +148 -51
- package/lib/sandbox/control/lifecycle.ts +34 -28
- package/lib/sandbox/control/protocol.ts +1 -3
- package/lib/sandbox/control/server.ts +15 -12
- package/lib/sandbox/control/state.ts +7 -7
- package/lib/sandbox/mounts.ts +4 -3
- package/lib/sandbox/recovery.ts +162 -34
- package/lib/sandbox/tools.ts +1 -1
- package/lib/sandbox/workspace-identity.ts +28 -0
- package/lib/sandbox/workspace-view.ts +14 -10
- package/lib/self-update.ts +341 -0
- package/lib/server/protocol.ts +5 -5
- package/lib/task/activity-log.ts +6 -1
- package/lib/task/artifact-lifecycle.ts +5 -3
- package/lib/task/codex-orchestration.ts +2 -1
- package/lib/task/command-options.ts +1 -2
- package/lib/task/commands/cat.ts +0 -4
- package/lib/task/commands/decisions.ts +80 -75
- package/lib/task/commands/files.ts +6 -6
- package/lib/task/commands/grep.ts +23 -51
- package/lib/task/commands/issue-body.ts +6 -6
- package/lib/task/commands/log.ts +22 -10
- package/lib/task/commands/show.ts +5 -6
- package/lib/task/commands/status.ts +8 -8
- package/lib/task/commit-operation.ts +25 -30
- package/lib/task/commit-policy.ts +1 -2
- package/lib/task/control-authority.ts +563 -0
- package/lib/task/create.ts +6 -1
- package/lib/task/current-contract.ts +49 -0
- package/lib/task/decision-details.ts +340 -0
- package/lib/task/decision-intents.ts +7 -2
- package/lib/task/events.ts +10 -5
- package/lib/task/index.ts +19 -20
- package/lib/task/ledger-intents.ts +6 -8
- package/lib/task/ledger.ts +17 -7
- package/lib/task/lifecycle.ts +20 -0
- package/lib/task/orchestration.ts +40 -15
- package/lib/task/review-artifacts.ts +53 -15
- package/lib/task/review-finalization.ts +33 -7
- package/lib/task/verification-engine.ts +33 -18
- package/lib/task/verification-review.ts +1 -1
- package/lib/task/workspace-snapshot.ts +4 -13
- package/lib/task/write.ts +20 -1
- package/lib/update.ts +6 -40
- package/lib/version.ts +6 -1
- package/package.json +1 -1
- package/templates/.agents/README.en.md +5 -3
- package/templates/.agents/README.zh-CN.md +5 -3
- package/templates/.agents/rules/compatibility-policy.en.md +5 -4
- package/templates/.agents/rules/compatibility-policy.zh-CN.md +5 -4
- package/templates/.agents/rules/create-issue.github.en.md +1 -1
- package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
- package/templates/.agents/rules/human-decision-context.en.md +9 -7
- package/templates/.agents/rules/human-decision-context.zh-CN.md +9 -7
- package/templates/.agents/rules/issue-fields.github.en.md +1 -1
- package/templates/.agents/rules/issue-fields.github.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.en.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.github.en.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-sync.github.en.md +1 -1
- package/templates/.agents/rules/issue-sync.github.zh-CN.md +2 -2
- package/templates/.agents/rules/milestone-inference.github.en.md +1 -1
- package/templates/.agents/rules/milestone-inference.github.zh-CN.md +1 -1
- package/templates/.agents/rules/next-step-output.en.md +3 -3
- package/templates/.agents/rules/next-step-output.zh-CN.md +3 -3
- package/templates/.agents/rules/no-mid-flow-questions.en.md +1 -1
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +1 -1
- package/templates/.agents/rules/pr-sync.en.md +1 -1
- package/templates/.agents/rules/pr-sync.github.en.md +1 -1
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +1 -1
- package/templates/.agents/rules/pr-sync.zh-CN.md +1 -1
- package/templates/.agents/rules/release-commands.github.en.md +6 -0
- package/templates/.agents/rules/release-commands.github.zh-CN.md +6 -0
- package/templates/.agents/rules/review-handshake.en.md +1 -1
- package/templates/.agents/rules/review-handshake.zh-CN.md +1 -1
- package/templates/.agents/rules/task-management.en.md +1 -2
- package/templates/.agents/rules/task-management.zh-CN.md +1 -2
- package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/block-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/check-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/close-codescan/SKILL.en.md +1 -1
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +1 -1
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/code-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/commit/SKILL.en.md +27 -7
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +3 -4
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +5 -5
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/complete-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/create-pr/SKILL.en.md +5 -7
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +5 -7
- package/templates/.agents/skills/create-pr/reference/change-report.en.md +9 -4
- package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +9 -4
- package/templates/.agents/skills/create-pr/scripts/change-report.mjs +203 -0
- package/templates/.agents/skills/create-release-note/SKILL.en.md +5 -6
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +5 -6
- package/templates/.agents/skills/create-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-issue/SKILL.en.md +1 -1
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/plan-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/restore-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +5 -3
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -0
- package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -0
- package/templates/.agents/skills/review-code/SKILL.en.md +5 -3
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/review-code/config/verify.en.json +1 -0
- package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -0
- package/templates/.agents/skills/review-code/reference/migration-risks.en.md +2 -1
- package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +2 -1
- package/templates/.agents/skills/review-plan/SKILL.en.md +5 -3
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/review-plan/config/verify.en.json +1 -0
- package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -0
- package/templates/.agents/skills/run-manual-validation/SKILL.en.md +4 -0
- package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +4 -0
- package/templates/.agents/skills/run-task/SKILL.en.md +4 -0
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +4 -0
- package/templates/.agents/skills/update-agent-infra/SKILL.en.md +2 -2
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +140 -109
- package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -2
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +2 -2
- package/templates/.agents/templates/task.en.md +1 -1
- package/templates/.agents/templates/task.zh-CN.md +1 -1
- package/templates/.claude/commands/analyze-task.en.md +1 -1
- package/templates/.claude/commands/analyze-task.zh-CN.md +1 -1
- package/templates/.claude/commands/block-task.en.md +1 -1
- package/templates/.claude/commands/block-task.zh-CN.md +1 -1
- package/templates/.claude/commands/cancel-task.en.md +1 -1
- package/templates/.claude/commands/cancel-task.zh-CN.md +1 -1
- package/templates/.claude/commands/check-task.en.md +1 -1
- package/templates/.claude/commands/check-task.zh-CN.md +1 -1
- package/templates/.claude/commands/code-task.en.md +1 -1
- package/templates/.claude/commands/code-task.zh-CN.md +1 -1
- package/templates/.claude/commands/commit.en.md +1 -1
- package/templates/.claude/commands/commit.zh-CN.md +1 -1
- package/templates/.claude/commands/complete-manual-validation.en.md +1 -1
- package/templates/.claude/commands/complete-manual-validation.zh-CN.md +1 -1
- package/templates/.claude/commands/complete-task.en.md +1 -1
- package/templates/.claude/commands/complete-task.zh-CN.md +1 -1
- package/templates/.claude/commands/create-pr.en.md +1 -1
- package/templates/.claude/commands/create-pr.zh-CN.md +1 -1
- package/templates/.claude/commands/plan-task.en.md +1 -1
- package/templates/.claude/commands/plan-task.zh-CN.md +1 -1
- package/templates/.claude/commands/review-analysis.en.md +1 -1
- package/templates/.claude/commands/review-analysis.zh-CN.md +1 -1
- package/templates/.claude/commands/review-code.en.md +1 -1
- package/templates/.claude/commands/review-code.zh-CN.md +1 -1
- package/templates/.claude/commands/review-plan.en.md +1 -1
- package/templates/.claude/commands/review-plan.zh-CN.md +1 -1
- package/templates/.claude/commands/run-manual-validation.en.md +1 -1
- package/templates/.claude/commands/run-manual-validation.zh-CN.md +1 -1
- package/templates/.claude/commands/run-task.en.md +1 -1
- package/templates/.claude/commands/run-task.zh-CN.md +1 -1
- package/templates/.claude/commands/watch-pr.en.md +1 -1
- package/templates/.claude/commands/watch-pr.zh-CN.md +1 -1
- package/templates/{.trae/skills → .traecli/commands}/update-agent-infra.en.md +0 -1
- package/templates/{.trae/skills → .traecli/commands}/update-agent-infra.zh-CN.md +0 -1
- package/dist/lib/builtin-tuis.js +0 -40
- package/lib/builtin-tuis.ts +0 -56
package/lib/update.ts
CHANGED
|
@@ -20,13 +20,11 @@ type UpdateConfig = {
|
|
|
20
20
|
org: string;
|
|
21
21
|
language: string;
|
|
22
22
|
platform?: { type?: string };
|
|
23
|
-
requiresPullRequest?: boolean; // legacy field; read-only, migrated to prFlow then removed
|
|
24
23
|
prFlow?: 'required' | 'disabled';
|
|
25
24
|
sandbox?: Record<string, unknown>;
|
|
26
25
|
task?: { shortIdLength: number };
|
|
27
26
|
labels?: Record<string, unknown>;
|
|
28
27
|
files?: Partial<FileRegistry>;
|
|
29
|
-
tuis?: unknown;
|
|
30
28
|
agentClients?: unknown;
|
|
31
29
|
customTUIs?: unknown;
|
|
32
30
|
};
|
|
@@ -46,28 +44,9 @@ const defaults = JSON.parse(
|
|
|
46
44
|
const CONFIG_DIR = '.agents';
|
|
47
45
|
const CONFIG_PATH = path.join(CONFIG_DIR, '.airc.json');
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
// `prFlow` preference. `true` (the old default / "PR flow on") maps to the
|
|
51
|
-
// strong constraint `required`; `false` maps to `disabled`. A missing or
|
|
52
|
-
// already-migrated config is left untouched (idempotent). Returns the new
|
|
53
|
-
// prFlow value when a migration happened, otherwise null.
|
|
54
|
-
function migratePrFlow(config: UpdateConfig): 'required' | 'disabled' | null {
|
|
55
|
-
if (config.requiresPullRequest === true) {
|
|
56
|
-
delete config.requiresPullRequest;
|
|
57
|
-
config.prFlow = 'required';
|
|
58
|
-
return 'required';
|
|
59
|
-
}
|
|
60
|
-
if (config.requiresPullRequest === false) {
|
|
61
|
-
delete config.requiresPullRequest;
|
|
62
|
-
config.prFlow = 'disabled';
|
|
63
|
-
return 'disabled';
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
async function cmdUpdate(): Promise<void> {
|
|
47
|
+
async function cmdSync(): Promise<void> {
|
|
69
48
|
console.log('');
|
|
70
|
-
console.log(' ai
|
|
49
|
+
console.log(' ai sync');
|
|
71
50
|
console.log(' ==================================');
|
|
72
51
|
console.log('');
|
|
73
52
|
|
|
@@ -104,7 +83,6 @@ async function cmdUpdate(): Promise<void> {
|
|
|
104
83
|
const sandboxAdded = !config.sandbox;
|
|
105
84
|
const taskAdded = !config.task;
|
|
106
85
|
const labelsAdded = !config.labels;
|
|
107
|
-
const prFlowMigrated = migratePrFlow(config);
|
|
108
86
|
if (platformAdded) config.platform = structuredClone(defaults.platform);
|
|
109
87
|
if (sandboxAdded) config.sandbox = structuredClone(defaults.sandbox);
|
|
110
88
|
if (taskAdded) config.task = structuredClone(defaults.task);
|
|
@@ -119,7 +97,7 @@ async function cmdUpdate(): Promise<void> {
|
|
|
119
97
|
language
|
|
120
98
|
});
|
|
121
99
|
|
|
122
|
-
info(`
|
|
100
|
+
info(`Syncing seed files for: ${project}`);
|
|
123
101
|
console.log('');
|
|
124
102
|
|
|
125
103
|
// update skill
|
|
@@ -137,12 +115,6 @@ async function cmdUpdate(): Promise<void> {
|
|
|
137
115
|
replacements
|
|
138
116
|
);
|
|
139
117
|
ok('Updated .agents/scripts/lib/agent-infra-package.js');
|
|
140
|
-
try {
|
|
141
|
-
fs.unlinkSync(path.join('.agents', 'skills', 'update-agent-infra', 'scripts', 'sync-templates.cjs'));
|
|
142
|
-
} catch {
|
|
143
|
-
// Ignore missing legacy script from pre-ESM installs.
|
|
144
|
-
}
|
|
145
|
-
|
|
146
118
|
const added = {
|
|
147
119
|
managed: workflowPlan.projectAssets.registry.managed.filter(
|
|
148
120
|
(entry) => !currentRegistry.managed.includes(entry)
|
|
@@ -165,7 +137,7 @@ async function cmdUpdate(): Promise<void> {
|
|
|
165
137
|
for (const entry of added.merged) {
|
|
166
138
|
ok(` merged: ${entry}`);
|
|
167
139
|
}
|
|
168
|
-
} else if (platformAdded || sandboxAdded || taskAdded || labelsAdded
|
|
140
|
+
} else if (platformAdded || sandboxAdded || taskAdded || labelsAdded) {
|
|
169
141
|
if (platformAdded) {
|
|
170
142
|
info(`Default platform config added to ${CONFIG_PATH}.`);
|
|
171
143
|
}
|
|
@@ -178,9 +150,6 @@ async function cmdUpdate(): Promise<void> {
|
|
|
178
150
|
if (labelsAdded) {
|
|
179
151
|
info(`Default labels.in config added to ${CONFIG_PATH}.`);
|
|
180
152
|
}
|
|
181
|
-
if (prFlowMigrated) {
|
|
182
|
-
info(`Migrated legacy requiresPullRequest to prFlow="${prFlowMigrated}" in ${CONFIG_PATH}.`);
|
|
183
|
-
}
|
|
184
153
|
} else {
|
|
185
154
|
info(`File registry changed in ${CONFIG_PATH}.`);
|
|
186
155
|
}
|
|
@@ -196,15 +165,12 @@ async function cmdUpdate(): Promise<void> {
|
|
|
196
165
|
if (hasNewEntries && platformAdded) {
|
|
197
166
|
info(`Default platform config added to ${CONFIG_PATH}.`);
|
|
198
167
|
}
|
|
199
|
-
if (hasNewEntries && prFlowMigrated) {
|
|
200
|
-
info(`Migrated legacy requiresPullRequest to prFlow="${prFlowMigrated}" in ${CONFIG_PATH}.`);
|
|
201
|
-
}
|
|
202
168
|
ok(`Updated ${CONFIG_PATH}`);
|
|
203
169
|
}
|
|
204
170
|
|
|
205
171
|
// done
|
|
206
172
|
console.log('');
|
|
207
|
-
ok('Seed files
|
|
173
|
+
ok('Seed files synced successfully!');
|
|
208
174
|
console.log('');
|
|
209
175
|
if (workflowPlan.nextSteps.length === 0) {
|
|
210
176
|
console.log(' No Agent Client project integration enabled.');
|
|
@@ -220,4 +186,4 @@ async function cmdUpdate(): Promise<void> {
|
|
|
220
186
|
}
|
|
221
187
|
}
|
|
222
188
|
|
|
223
|
-
export {
|
|
189
|
+
export { cmdSync };
|
package/lib/version.ts
CHANGED
|
@@ -11,5 +11,10 @@ if (!packageJsonUrl) {
|
|
|
11
11
|
|
|
12
12
|
const { version } = JSON.parse(readFileSync(packageJsonUrl, 'utf8'));
|
|
13
13
|
const VERSION = `v${version}`;
|
|
14
|
+
const AGENT_INFRA_VERSION_PATTERN = /^v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
function isValidAgentInfraVersion(value: unknown): value is string {
|
|
17
|
+
return typeof value === 'string' && AGENT_INFRA_VERSION_PATTERN.test(value);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { VERSION, isValidAgentInfraVersion };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fitlab-ai/agent-infra",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.11",
|
|
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",
|
|
@@ -124,7 +124,7 @@ To adapt agent-infra to a private code-hosting platform:
|
|
|
124
124
|
|
|
125
125
|
1. Set `.agents/.airc.json` `platform.type` to a stable identifier such as `my-platform`.
|
|
126
126
|
2. Copy the generated rule files in `.agents/rules/` and adapt them to your platform's CLI or API while keeping the runtime filenames unchanged.
|
|
127
|
-
3. Add the customized rule files to `.agents/.airc.json` `files.ejected` so future `
|
|
127
|
+
3. Add the customized rule files to `.agents/.airc.json` `files.ejected` so future `ai sync` runs do not overwrite them.
|
|
128
128
|
4. If you maintain a fork of the template source, add matching `.{platform}.` template variants before adding that platform identifier to the sync logic.
|
|
129
129
|
5. Validate the customized workflow on a test task before rolling it out broadly.
|
|
130
130
|
|
|
@@ -227,7 +227,7 @@ Ordinary `managed` files keep their overwrite semantics. A small set of platform
|
|
|
227
227
|
|
|
228
228
|
## Agent Client Configuration
|
|
229
229
|
|
|
230
|
-
Use the top-level `.agents/.airc.json` `agentClients` array to configure all
|
|
230
|
+
Use the top-level `.agents/.airc.json` `agentClients` array to configure all five built-in clients (`claude-code`, `codex`, `antigravity-cli`, `opencode`, `traecli`). Each canonical entry has three required fields and one optional orchestration policy:
|
|
231
231
|
|
|
232
232
|
| Field | Meaning |
|
|
233
233
|
|-------|---------|
|
|
@@ -250,7 +250,9 @@ ai agent-client configure
|
|
|
250
250
|
|
|
251
251
|
`enable` and `disable` only change `enabled`; `configure` edits both dimensions. `ai init` asks which clients to enable and preserves the displayed defaults when you press Enter. All clients default to `installInSandbox: true`.
|
|
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
|
+
|
|
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 only non-client tools such as `agent-infra` and custom tools. A legacy `tuis` field or a built-in client id in `sandbox.tools` is rejected, and configuration is never rewritten automatically.
|
|
254
256
|
|
|
255
257
|
### Side effects of disabling an Agent Client
|
|
256
258
|
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
|
|
123
123
|
1. 在 `.agents/.airc.json` 中把 `platform.type` 设为稳定标识,例如 `my-platform`。
|
|
124
124
|
2. 以 `.agents/rules/` 下已生成的规则文件为起点,改写为你的平台 CLI 或 API 调用,同时保持运行时文件名不变。
|
|
125
|
-
3. 将这些自定义规则文件加入 `.agents/.airc.json` 的 `files.ejected`,避免后续执行 `
|
|
125
|
+
3. 将这些自定义规则文件加入 `.agents/.airc.json` 的 `files.ejected`,避免后续执行 `ai sync` 时被覆盖。
|
|
126
126
|
4. 如果你维护的是模板源码分支或私有 fork,需要先补齐对应的 `.{platform}.` 模板变体,再把该平台标识加入模板同步逻辑。
|
|
127
127
|
5. 在正式推广前,先用一个测试任务完整验证工作流和 gate 校验。
|
|
128
128
|
|
|
@@ -225,7 +225,7 @@ disable-model-invocation: true # 可选;由支持该能力的 TUI 适配器
|
|
|
225
225
|
|
|
226
226
|
## Agent Client 配置
|
|
227
227
|
|
|
228
|
-
`.agents/.airc.json` 顶层 `agentClients`
|
|
228
|
+
`.agents/.airc.json` 顶层 `agentClients` 数组用于配置全部五个内建客户端(`claude-code`、`codex`、`antigravity-cli`、`opencode`、`traecli`)。每个规范条目包含三个必填字段和一个可选编排策略:
|
|
229
229
|
|
|
230
230
|
| 字段 | 含义 |
|
|
231
231
|
|------|------|
|
|
@@ -248,7 +248,9 @@ ai agent-client configure
|
|
|
248
248
|
|
|
249
249
|
`enable` 和 `disable` 只修改 `enabled`;`configure` 同时编辑两个维度。`ai init` 会询问启用哪些客户端,直接回车会保留界面展示的默认值。所有客户端的 `installInSandbox` 默认均为 `true`。
|
|
250
250
|
|
|
251
|
-
|
|
251
|
+
TraeCode CLI 以 `.agents/skills/` 作为 Skill 的唯一权威源。agent-infra 仅在 `.traecli/commands/` 下生成轻量 slash-command 包装文件;每个包装文件读取对应的共享 Skill,并在该 Skill 声明参数时转发 `$ARGUMENTS`。它不会把 Skill 包镜像到 `.trae/skills/`;该目录继续由用户所有,仅用于有意添加的 Trae 专属覆盖。
|
|
252
|
+
|
|
253
|
+
`agentClients` 是内建客户端状态的唯一配置来源。顶层数组必须按固定规范顺序包含全部五个内建客户端;`sandbox.tools` 只列出 `agent-infra` 和自定义工具等非客户端工具。旧 `tuis` 字段或 `sandbox.tools` 中的内建客户端 id 会被拒绝,配置不会被自动改写。
|
|
252
254
|
|
|
253
255
|
### 取消 Agent Client 的副作用
|
|
254
256
|
|
|
@@ -15,7 +15,7 @@ Add or extend compatibility only when the task or an existing public contract ex
|
|
|
15
15
|
1. **Subject**: concrete consumers, released versions, or stored data still using the old contract.
|
|
16
16
|
2. **Necessity**: why an atomic cutover, one-time conversion, or actionable failure is insufficient.
|
|
17
17
|
3. **Window**: a version, date, or verifiable endpoint for the compatibility period.
|
|
18
|
-
4. **Exit**: removal conditions
|
|
18
|
+
4. **Exit**: removal conditions and the code, tests, and documentation to delete.
|
|
19
19
|
|
|
20
20
|
If any item is missing, compatibility is unauthorized scope expansion. Implement the current contract, fail closed with an actionable repair message for old input, or perform an explicit one-time conversion outside the main path.
|
|
21
21
|
|
|
@@ -23,6 +23,7 @@ If any item is missing, compatibility is unauthorized scope expansion. Implement
|
|
|
23
23
|
|
|
24
24
|
- Keep one canonical write format and one source of truth. Do not dual-write, maintain shadow state, or try the new path before silently falling back to the old path.
|
|
25
25
|
- Concentrate an approved conversion at one boundary and immediately enter the current model; business logic must not understand several historical versions.
|
|
26
|
+
- Mark temporarily retained compatibility at its single boundary with `TODO(compat): Remove ... once ...`, naming the removal target and a verifiable removal condition. The TODO stays co-located with the code; tasks and issues are optional scheduling aids, not compatibility facts or workflow gates.
|
|
26
27
|
- Use warnings only when the primary action remains correct and the user can retry an ancillary operation. Never hide uncertainty about identity, authorization, data interpretation, or side-effect correctness.
|
|
27
28
|
- When removing an old capability, remove its adapters, branches, fixtures, tests, and migration documentation together. Do not add negative tests that permanently remember deleted behavior.
|
|
28
29
|
- Never guess the meaning of unknown state. Preserve it, stop writes, and provide rebuild or manual-repair guidance.
|
|
@@ -31,9 +32,9 @@ If any item is missing, compatibility is unauthorized scope expansion. Implement
|
|
|
31
32
|
|
|
32
33
|
- **Analysis**: separate explicit compatibility requirements from model speculation and identify real consumers or stored data. State current-only when evidence is absent.
|
|
33
34
|
- **Plan**: for approved compatibility, identify the boundary, single conversion point, window, and deletion plan. Do not present a compatibility layer as the default low-risk option.
|
|
34
|
-
- **Implementation**: implement only the approved compatibility budget. Do not preserve an unapproved old branch “just in case.”
|
|
35
|
-
- **Review**: verify the four admission items, single source of truth,
|
|
35
|
+
- **Implementation**: implement only the approved compatibility budget, and add or move its `TODO(compat)` at the single compatibility boundary. Do not preserve an unapproved old branch “just in case.”
|
|
36
|
+
- **Review**: verify the four admission items, single source of truth, exit condition, and co-located `TODO(compat)`. Flag unauthorized compatibility, indefinite shims, dual writes, and runtime-path migrations as scope and maintainability problems.
|
|
36
37
|
|
|
37
38
|
## Existing Compatibility Logic
|
|
38
39
|
|
|
39
|
-
During an ordinary task,
|
|
40
|
+
During an ordinary task, when out-of-scope compatibility is found, only ensure that its single boundary has one `TODO(compat)` and record the location and risk. Do not delete the logic or duplicate the marker. A dedicated simplification task should first search those TODOs and inventory consumers and stored data, then process items in this order: remove now, warn then remove, retain temporarily.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
1. **对象**:仍在使用旧契约的具体消费者、已发布版本或存量数据。
|
|
16
16
|
2. **必要性**:为何不能原子切换、一次性转换或直接失败并提示修复。
|
|
17
17
|
3. **期限**:兼容窗口的版本、日期或可验证终点。
|
|
18
|
-
4.
|
|
18
|
+
4. **退出**:删除条件以及届时要删除的代码、测试和文档。
|
|
19
19
|
|
|
20
20
|
缺少任一项时,兼容属于未经授权的范围扩张:按当前契约实现;遇到旧输入时失败关闭并提供可操作提示,或在主路径之外执行一次性显式转换。
|
|
21
21
|
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
- 当前契约只有一个规范写入格式和一个事实源;禁止双写、影子状态和“先试新逻辑、失败再走旧逻辑”。
|
|
25
25
|
- 兼容转换集中在单一边界,转换后立即进入当前模型;业务核心不得感知多个历史版本。
|
|
26
|
+
- 暂时保留的兼容逻辑必须在唯一兼容边界使用 `TODO(compat): Remove ... once ...` 标记要删除的对象和可验证删除条件。该 TODO 与代码同源;任务或 Issue 只用于可选排期,不作为兼容事实源或工作流门禁。
|
|
26
27
|
- warning 只用于主动作仍然正确且用户可重试的外围问题,不能掩盖身份、授权、数据解释或副作用正确性的不确定。
|
|
27
28
|
- 删除旧能力时同步删除专属 adapter、分支、fixture、测试和迁移文档;不要新增“已删除能力不存在”的反向断言。
|
|
28
29
|
- 不为兼容而猜测未知状态。无法唯一解释时保留原数据、停止写入并给出重建或人工修复提示。
|
|
@@ -31,9 +32,9 @@
|
|
|
31
32
|
|
|
32
33
|
- **分析**:区分用户明确兼容要求与模型自行推测;列出现存消费者和数据证据。没有证据时明确采用 current-only。
|
|
33
34
|
- **方案**:为获准兼容标出边界、唯一转换点、窗口和删除计划;不得把兼容层当作低风险默认方案。
|
|
34
|
-
-
|
|
35
|
-
-
|
|
35
|
+
- **实现**:只实现已批准的兼容预算,并在唯一兼容边界写入或随重构移动 `TODO(compat)`。方案未授权的旧分支不得“顺手保留”。
|
|
36
|
+
- **审查**:逐项核对四项准入证据、单一事实源、退出条件及就地 `TODO(compat)`。未经授权的兼容、无期限 shim、双写或主路径迁移应作为范围与维护性问题提出。
|
|
36
37
|
|
|
37
38
|
## 既有兼容逻辑
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
普通任务发现范围外的既有兼容逻辑时,只确保唯一边界存在 `TODO(compat)` 并记录位置和风险,不擅自删除,也不重复添加标记。专门的简化任务应先检索这些 TODO、建立消费者与存量数据视图,再按“可立即删除 → 先告警后删除 → 暂时保留”的顺序逐项处理。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue Creation
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
After `create-task` writes task.md, create and initialize the Issue through declarative internal intents:
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue 创建
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
当 `create-task` 完成本地 `task.md` 落盘后,通过声明式内部命令创建 Issue:
|
|
6
6
|
|
|
@@ -4,7 +4,7 @@ This rule governs every new `[needs-human-decision]` detail block produced by an
|
|
|
4
4
|
|
|
5
5
|
## Self-contained Context
|
|
6
6
|
|
|
7
|
-
A maintainer must be able to understand the issue and choose without knowing the internal workflow or asking a model to reconstruct context.
|
|
7
|
+
A maintainer must be able to understand the issue and choose without knowing the internal workflow or asking a model to reconstruct context. In a fixed order, explain in plain language what must be chosen, why a decision is needed now, what it affects, and what could go wrong if it is wrong or postponed. Then explain each option, followed by the recommendation and its reason.
|
|
8
8
|
|
|
9
9
|
Provide at least two options with short names. For each option, explain what would actually be done, what would happen after choosing it, its benefits, and its trade-offs. Each decision must also include at least one everyday example or analogy that stays true to the real effects and helps the maintainer compare the options. Explain internal terms such as stage, severity, and evidence the first time they appear. IDs and evidence are for lookup and troubleshooting; they do not replace the plain-language explanation.
|
|
10
10
|
|
|
@@ -13,13 +13,10 @@ Provide at least two options with short names. For each option, explain what wou
|
|
|
13
13
|
```markdown
|
|
14
14
|
### {AN-N|PL-N|CD-N|HD-N}: {Title} [needs-human-decision]
|
|
15
15
|
|
|
16
|
-
- **Why a decision is needed now**: {plain-language facts, constraints, and why work cannot simply continue}
|
|
17
16
|
- **What needs a decision**: {the one choice that must be made}
|
|
18
|
-
- **
|
|
19
|
-
- **Why this choice**: {reason based on benefits, trade-offs, and current constraints}
|
|
17
|
+
- **Why a decision is needed now**: {plain-language facts, constraints, and why work cannot simply continue}
|
|
20
18
|
- **What this affects**: {affected behavior, files, users, or future practice}
|
|
21
19
|
- **What could go wrong**: {problems caused by the wrong choice or no action}
|
|
22
|
-
- **Everyday example or analogy**: {a familiar comparison that accurately reflects the real effects and helps compare the options}
|
|
23
20
|
|
|
24
21
|
#### Option A: {Name}
|
|
25
22
|
|
|
@@ -27,6 +24,7 @@ Provide at least two options with short names. For each option, explain what wou
|
|
|
27
24
|
- **What happens after choosing it**: {specific changes for users, behavior, or follow-up work}
|
|
28
25
|
- **Benefits**: {what this option provides}
|
|
29
26
|
- **Trade-offs**: {what this option costs and where it falls short}
|
|
27
|
+
- **Example or analogy**: {a plain-language example that shows this option's real effect}
|
|
30
28
|
|
|
31
29
|
#### Option B: {Name}
|
|
32
30
|
|
|
@@ -34,9 +32,13 @@ Provide at least two options with short names. For each option, explain what wou
|
|
|
34
32
|
- **What happens after choosing it**: {specific changes for users, behavior, or follow-up work}
|
|
35
33
|
- **Benefits**: {what this option provides}
|
|
36
34
|
- **Trade-offs**: {what this option costs and where it falls short}
|
|
35
|
+
- **Example or analogy**: {a plain-language example that shows this option's real effect}
|
|
36
|
+
|
|
37
|
+
- **Recommended choice**: {Option A/B/...}
|
|
38
|
+
- **Why this choice**: {reason based on benefits, trade-offs, and current constraints}
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
Option C and supporting evidence may be added, but none of the information above may be omitted or collapsed into an incomparable one-line option list.
|
|
41
|
+
Option C and supporting evidence may be added, but none of the information above may be omitted or collapsed into an incomparable one-line option list. Every option needs its own example or analogy, and it does not replace facts, concrete effects, or risks. Put the recommendation and its reason after all options. The heading ID must match the task.md Review Disagreement Ledger row. Its evidence (the reference used to find the original explanation) must point to this stable heading anchor.
|
|
40
42
|
|
|
41
43
|
## Implementation Intent Declaration
|
|
42
44
|
|
|
@@ -44,4 +46,4 @@ For the code stage, the author must add `**Implementation required**: yes/no` af
|
|
|
44
46
|
|
|
45
47
|
## Decision Closure
|
|
46
48
|
|
|
47
|
-
Use `ai task decisions <
|
|
49
|
+
Use `ai task decisions [--task <ref> | -t <ref>] [--item <ordinal|ledger-id> | -i <ordinal|ledger-id>]` to inspect full context and `ai decide [--task <ref> | -t <ref>] (--item <ordinal|ledger-id> | -i <ordinal|ledger-id>) <decision>` to record the ruling. `ai decide` updates the row to `human-decided`, creates an independent `HDR-N` record, and updates evidence and the activity log; do not manually imitate only part of that transaction.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## 自足性要求
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
详情必须让维护者不需要了解内部流程,也不需要再问模型,就能看懂并做选择。按固定顺序先用大白话说明要决定什么、为什么现在需要决定、会影响什么以及选错或暂不处理会怎样;再分别说明方案 A/B/...,最后给出建议选哪个及原因。
|
|
8
8
|
|
|
9
9
|
每项至少提供两个有简短名称的方案,并分别写清实际会怎么做、选了以后会怎样、好处和代价。每项还必须提供至少一个贴近日常、且不歪曲事实的例子或类比,帮助维护者比较方案。第一次出现 stage、severity、evidence 等内部术语时,必须顺手解释它们的意思;ID 和 evidence 只用于后续查找和排查,不能代替问题说明。
|
|
10
10
|
|
|
@@ -13,13 +13,10 @@
|
|
|
13
13
|
```markdown
|
|
14
14
|
### {AN-N|PL-N|CD-N|HD-N}:{标题} [needs-human-decision]
|
|
15
15
|
|
|
16
|
-
- **为什么现在要决定**:{用大白话说明已知情况、限制,以及为什么不能直接继续}
|
|
17
16
|
- **要决定什么**:{本次只需要选定的一件事}
|
|
18
|
-
-
|
|
19
|
-
- **为什么这样建议**:{结合好处、代价和现有限制说明原因}
|
|
17
|
+
- **为什么现在要决定**:{用大白话说明已知情况、限制,以及为什么不能直接继续}
|
|
20
18
|
- **会影响什么**:{会受影响的功能、文件、用户或后续做法}
|
|
21
19
|
- **如果选错或暂不处理**:{可能出现的问题}
|
|
22
|
-
- **打个比方**:{用一个贴近日常且符合真实影响的例子或类比,帮助比较方案}
|
|
23
20
|
|
|
24
21
|
#### 方案 A:{名称}
|
|
25
22
|
|
|
@@ -27,6 +24,7 @@
|
|
|
27
24
|
- **选了以后会怎样**:{用户、功能或后续工作会发生什么具体变化}
|
|
28
25
|
- **好处**:{选择该方案能得到什么}
|
|
29
26
|
- **代价**:{选择该方案要付出什么、有哪些局限}
|
|
27
|
+
- **例子/类比**:{用大白话举一个能说明该方案实际效果的例子}
|
|
30
28
|
|
|
31
29
|
#### 方案 B:{名称}
|
|
32
30
|
|
|
@@ -34,9 +32,13 @@
|
|
|
34
32
|
- **选了以后会怎样**:{用户、功能或后续工作会发生什么具体变化}
|
|
35
33
|
- **好处**:{选择该方案能得到什么}
|
|
36
34
|
- **代价**:{选择该方案要付出什么、有哪些局限}
|
|
35
|
+
- **例子/类比**:{用大白话举一个能说明该方案实际效果的例子}
|
|
36
|
+
|
|
37
|
+
- **建议选哪个**:{方案 A/B/...}
|
|
38
|
+
- **为什么这样建议**:{结合好处、代价和现有限制说明原因}
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
可增加方案 C
|
|
41
|
+
可增加方案 C 或补充证据,但不得省略上述信息或把多个方案压缩为无法分别比较的一行。每个方案都要有自己的例子或类比,且不能替代事实、实际影响和风险说明。建议和建议原因放在所有方案之后。标题 ID 必须与 task.md `## 审查分歧账本` 行一致;evidence(用于定位原始说明的引用)必须指向该标题的稳定锚点。
|
|
40
42
|
|
|
41
43
|
## 实现意图声明
|
|
42
44
|
|
|
@@ -44,4 +46,4 @@ code 阶段的提出者必须在详情块的方案说明后另写 `**是否需
|
|
|
44
46
|
|
|
45
47
|
## 裁决闭环
|
|
46
48
|
|
|
47
|
-
使用 `ai task decisions <
|
|
49
|
+
使用 `ai task decisions [--task <ref> | -t <ref>] [--item <序号|账本ID> | -i <序号|账本ID>]` 查看完整详情,使用 `ai decide [--task <ref> | -t <ref>] (--item <序号|账本ID> | -i <序号|账本ID>) <裁决内容>` 写入裁决。`ai decide` 负责把目标行更新为 `human-decided`、创建独立 `HDR-N` 记录、更新 evidence 与活动日志;不得手工模拟其中一部分写入。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue Fields
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
Synchronize Issue Type and pinned fields through one intent:
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue 字段
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
Issue Type 与 pinned fields 统一由 `platform-issue` intent 动态读取组织 schema 并同步:
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR Platform Intents
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
PR lookup, creation, binding, and metadata synchronization go through typed internal intents. Skills decide branches and write titles/bodies; they do not assemble platform commands.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR Platform Intents
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
PR lookup, creation, binding, and metadata synchronization go through typed internal intents. Skills decide branches and write titles/bodies; they do not assemble platform commands.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR 平台意图命令
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
PR 资源的定位、创建、绑定和元数据同步统一通过 typed internal intent;SKILL 只负责决定分支、标题、正文和调用时机,不直接拼装平台命令。
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR 平台意图命令
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
PR 资源的定位、创建、绑定和元数据同步统一通过 typed internal intent;SKILL 只负责决定分支、标题、正文和调用时机,不直接拼装平台命令。
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue Sync
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
## Marker Registry
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue 同步规则
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
## Marker 注册表
|
|
6
6
|
|
|
@@ -27,7 +27,7 @@ agent-infra-internal platform-context resolve [--cwd <path>]
|
|
|
27
27
|
agent-infra-internal platform-comment list --issue <N> [--cwd <path>]
|
|
28
28
|
agent-infra-internal platform-comment owner <task-ref>
|
|
29
29
|
agent-infra-internal platform-comment sync <task-ref> \
|
|
30
|
-
--kind task|artifact|summary|cancel --agent
|
|
30
|
+
--kind task|artifact|summary|cancel --agent {standard-agent-token} \
|
|
31
31
|
[--artifact <canonical.md>] [--body-file <path|->] [--backfill]
|
|
32
32
|
```
|
|
33
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Milestone Inference
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
Milestones narrow through declarative Issue intents:
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Milestone 推断规则
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
Milestone 继续按生命周期逐步收窄,但候选读取、分支判断、权限降级和写入统一由 `platform-issue` 处理。
|
|
6
6
|
|
|
@@ -110,11 +110,11 @@ This section is a **third standalone rule, co-equal with the two above**, used o
|
|
|
110
110
|
…(one entry per status=needs-human-decision row of this stage in task.md `## 审查分歧账本`)
|
|
111
111
|
|
|
112
112
|
View details:
|
|
113
|
-
- All pending decisions: ai task decisions {task-ref}
|
|
114
|
-
- A single item's full background/options/impact/recommendation: ai task decisions {task-ref} <ordinal|ledger-id>
|
|
113
|
+
- All pending decisions: ai task decisions --task {task-ref}
|
|
114
|
+
- A single item's full background/options/impact/recommendation: ai task decisions --task {task-ref} --item <ordinal|ledger-id>
|
|
115
115
|
|
|
116
116
|
To resolve:
|
|
117
|
-
- ai decide {task-ref} <ordinal|ledger-id> <decision and rationale>
|
|
117
|
+
- ai decide --task {task-ref} --item <ordinal|ledger-id> <decision and rationale>
|
|
118
118
|
|
|
119
119
|
This command atomically creates the `HDR-N` ruling record, flips the target ledger row to `human-decided`, and updates evidence and the activity log; do not manually edit only part of the transaction.
|
|
120
120
|
|
|
@@ -110,11 +110,11 @@ Completed at: YYYY-MM-DD HH:mm:ss
|
|
|
110
110
|
…(task.md `## 审查分歧账本` 中本阶段每个 status=needs-human-decision 行一条)
|
|
111
111
|
|
|
112
112
|
查看详情:
|
|
113
|
-
- 全部待裁决项:ai task decisions {task-ref}
|
|
114
|
-
- 单项完整背景/选项/影响/建议:ai task decisions {task-ref} <序号|账本ID>
|
|
113
|
+
- 全部待裁决项:ai task decisions --task {task-ref}
|
|
114
|
+
- 单项完整背景/选项/影响/建议:ai task decisions --task {task-ref} --item <序号|账本ID>
|
|
115
115
|
|
|
116
116
|
完成裁决:
|
|
117
|
-
- ai decide {task-ref} <序号|账本ID> <裁决内容与理由>
|
|
117
|
+
- ai decide --task {task-ref} --item <序号|账本ID> <裁决内容与理由>
|
|
118
118
|
|
|
119
119
|
该命令原子写入 `HDR-N` 裁定记录、把目标账本行翻为 `human-decided`、更新 evidence 与活动日志;不要手工只修改其中一部分。
|
|
120
120
|
|
|
@@ -85,7 +85,7 @@ Use these checks together:
|
|
|
85
85
|
- **Small-impact exemption**: if it is only a local, reversible, low-cost execution detail, record it under `## Assumptions` instead of upgrading it to a human ruling.
|
|
86
86
|
- **Fallback**: when unsure whether it is key, treat it as key; `review-*` must check whether the executor missed any `[needs-human-decision]` markings that should have been upgraded.
|
|
87
87
|
|
|
88
|
-
> Use `ai task decisions <
|
|
88
|
+
> Use `ai task decisions [--task <ref> | -t <ref>]` to view all pending decisions of a task and their detail blocks.
|
|
89
89
|
|
|
90
90
|
## Human Review Checkpoint Semantics
|
|
91
91
|
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
- **小影响豁免**:若它只是局部、可逆、低成本的执行细节,写入 `## 假设` 即可,不升级为人工裁决。
|
|
86
86
|
- **兜底**:无法判断是否关键时按关键处理;`review-*` 需要复核执行方是否漏标应升级的 `[needs-human-decision]`。
|
|
87
87
|
|
|
88
|
-
> 用户可用 `ai task decisions <
|
|
88
|
+
> 用户可用 `ai task decisions [--task <ref> | -t <ref>]` 查看某任务全部待裁决项及其详情块。
|
|
89
89
|
|
|
90
90
|
## 人工审查检查点语义
|
|
91
91
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR Summary Synchronization
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
The model writes the semantic reviewer summary. Typed core owns canonical artifact selection, the marker, current HEAD, paginated comment lookup, and create/update/no-op reconciliation.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR Summary Synchronization
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
The model writes the semantic reviewer summary. Typed core owns canonical artifact selection, marker/HEAD wrapping, paginated comment lookup, and reconciliation.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR 摘要同步
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
PR 摘要的语义聚合由模型完成;canonical 产物选择、marker、当前 HEAD、分页评论查找和 create/update/no-op 由 typed core 负责。
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR 摘要同步
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
PR 摘要的语义聚合由模型完成;canonical 产物选择、marker、当前 HEAD、分页评论查找和 create/update/no-op 由 typed core 负责。
|
|
6
6
|
|
|
@@ -14,6 +14,12 @@ agent-infra-internal platform-release-notes context \
|
|
|
14
14
|
|
|
15
15
|
The result contains `history`, `pullRequests`, `closingIssues`, and commit `authors` with normalized `login` / `resolution` values. `status: no-op` with error code `PLATFORM_RELEASE_NOTES_UNSUPPORTED` means the current platform does not support remote release-note operations.
|
|
16
16
|
|
|
17
|
+
### Identity Safety Boundary
|
|
18
|
+
|
|
19
|
+
- Render an identity as `@login` only when `resolution` is `platform-user` or `platform-noreply` and `login` is non-empty.
|
|
20
|
+
- Exclude `resolution: unresolved` identities from the release-note contributor list. Never infer a login from a name, email address, domain, brand, or same-named platform account, and never substitute a guessed personal or organization account.
|
|
21
|
+
- Do not publish unresolved identity emails or identity-verification TODOs in Release notes. Record any required investigation outside the release workflow without creating a platform mention.
|
|
22
|
+
|
|
17
23
|
## Stage Release Notes
|
|
18
24
|
|
|
19
25
|
```bash
|