@fitlab-ai/agent-infra 0.9.5 → 0.9.6
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 +3 -3
- package/dist/lib/agent-clients/adapters/codex-lifecycle/app-server.js +126 -16
- package/dist/lib/agent-clients/adapters/codex-lifecycle/evidence.js +14 -2
- package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +48 -4
- package/dist/lib/agent-clients/adapters/codex.js +1 -1
- package/dist/lib/git/workflow.js +0 -1
- package/dist/lib/internal/codex-lifecycle.js +100 -2
- package/dist/lib/internal/release-workflow.js +108 -11
- package/dist/lib/internal/sandbox-control.js +43 -6
- package/dist/lib/internal/task-create.js +12 -4
- package/dist/lib/internal/task-orchestration.js +5 -4
- package/dist/lib/platform/issue-comments.js +2 -1
- package/dist/lib/release/workflow.js +29 -21
- package/dist/lib/sandbox/commands/create.js +15 -16
- package/dist/lib/sandbox/commands/prune.js +40 -16
- package/dist/lib/sandbox/commands/rm.js +318 -89
- package/dist/lib/sandbox/control/client.js +138 -22
- package/dist/lib/sandbox/control/executor.js +136 -0
- package/dist/lib/sandbox/control/lifecycle.js +348 -0
- package/dist/lib/sandbox/control/protocol.js +62 -26
- package/dist/lib/sandbox/control/server.js +222 -102
- package/dist/lib/sandbox/control/state.js +181 -0
- package/dist/lib/sandbox/index.js +2 -2
- package/dist/lib/sandbox/managed-fs.js +14 -2
- package/dist/lib/sandbox/mounts.js +35 -24
- package/dist/lib/sandbox/recovery.js +262 -45
- package/dist/lib/sandbox/workspace-view.js +73 -10
- package/dist/lib/sandbox/worktree-safety.js +196 -0
- package/dist/lib/server/process-control.js +6 -0
- package/dist/lib/task/artifact-lifecycle.js +5 -4
- package/dist/lib/task/codex-orchestration.js +161 -0
- package/dist/lib/task/commands/status.js +3 -0
- package/dist/lib/task/commands/validate.js +289 -0
- package/dist/lib/task/commit-finalization.js +36 -9
- package/dist/lib/task/delegation-receipts.js +25 -0
- package/dist/lib/task/events.js +10 -4
- package/dist/lib/task/finalization-artifacts.js +2 -1
- package/dist/lib/task/implementation-inputs.js +1 -7
- package/dist/lib/task/index.js +9 -0
- package/dist/lib/task/orchestration.js +133 -4
- package/dist/lib/task/verification-engine.js +38 -6
- package/dist/lib/task/verification.js +1 -0
- package/lib/agent-clients/adapters/codex-lifecycle/app-server.ts +142 -15
- package/lib/agent-clients/adapters/codex-lifecycle/evidence.ts +19 -3
- package/lib/agent-clients/adapters/codex-lifecycle/store.ts +51 -3
- package/lib/agent-clients/adapters/codex.ts +1 -1
- package/lib/git/workflow.ts +0 -1
- package/lib/internal/codex-lifecycle.ts +107 -3
- package/lib/internal/release-workflow.ts +107 -11
- package/lib/internal/sandbox-control.ts +38 -6
- package/lib/internal/task-create.ts +16 -4
- package/lib/internal/task-orchestration.ts +4 -4
- package/lib/platform/issue-comments.ts +2 -1
- package/lib/release/workflow.ts +69 -20
- package/lib/sandbox/commands/create.ts +17 -21
- package/lib/sandbox/commands/prune.ts +53 -15
- package/lib/sandbox/commands/rm.ts +368 -103
- package/lib/sandbox/control/client.ts +152 -28
- package/lib/sandbox/control/executor.ts +163 -0
- package/lib/sandbox/control/lifecycle.ts +342 -0
- package/lib/sandbox/control/protocol.ts +96 -69
- package/lib/sandbox/control/server.ts +239 -110
- package/lib/sandbox/control/state.ts +196 -0
- package/lib/sandbox/index.ts +2 -2
- package/lib/sandbox/managed-fs.ts +17 -2
- package/lib/sandbox/mounts.ts +31 -13
- package/lib/sandbox/recovery.ts +301 -60
- package/lib/sandbox/workspace-view.ts +81 -11
- package/lib/sandbox/worktree-safety.ts +234 -0
- package/lib/server/process-control.ts +11 -0
- package/lib/task/artifact-lifecycle.ts +5 -4
- package/lib/task/codex-orchestration.ts +233 -0
- package/lib/task/commands/status.ts +2 -0
- package/lib/task/commands/validate.ts +282 -0
- package/lib/task/commit-finalization.ts +52 -9
- package/lib/task/delegation-receipts.ts +52 -3
- package/lib/task/events.ts +9 -4
- package/lib/task/finalization-artifacts.ts +2 -1
- package/lib/task/implementation-inputs.ts +1 -5
- package/lib/task/index.ts +8 -0
- package/lib/task/orchestration.ts +199 -4
- package/lib/task/verification-engine.ts +42 -8
- package/lib/task/verification.ts +2 -1
- package/package.json +1 -1
- package/templates/.agents/hooks/lifecycle-delegation.js +48 -12
- package/templates/.agents/rules/lifecycle-orchestration.en.md +1 -1
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +1 -1
- package/templates/.agents/rules/no-mid-flow-questions.en.md +1 -0
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +1 -0
- package/templates/.agents/skills/post-release/SKILL.en.md +32 -6
- package/templates/.agents/skills/post-release/SKILL.zh-CN.md +32 -6
- package/templates/.agents/skills/run-manual-validation/SKILL.en.md +42 -0
- package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +42 -0
- package/templates/.agents/skills/run-manual-validation/config/verify.en.json +14 -0
- package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +14 -0
- package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +44 -0
- package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +44 -0
- package/templates/.agents/skills/run-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/run-task/reference/host-validation.en.md +3 -3
- package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +3 -3
- package/templates/.claude/commands/run-manual-validation.en.md +9 -0
- package/templates/.claude/commands/run-manual-validation.zh-CN.md +9 -0
- package/templates/.codex/hooks.json +8 -8
- package/templates/.opencode/commands/run-manual-validation.en.md +11 -0
- package/templates/.opencode/commands/run-manual-validation.zh-CN.md +11 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: run-manual-validation
|
|
3
|
+
description: >
|
|
4
|
+
Safely run task manual validation on the host and record standard evidence.
|
|
5
|
+
Use when validation needs host credentials, a real container, or in-place worktree state.
|
|
6
|
+
Only invoke automatically when the conversation includes a resolvable task reference.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Run Manual Validation
|
|
10
|
+
|
|
11
|
+
## Boundary
|
|
12
|
+
|
|
13
|
+
- Select the validation mode, call the sole mechanical entry point, and record evidence; do not mark PR manual validation complete.
|
|
14
|
+
- `complete-manual-validation` remains the maintainer's final registration after coverage is judged sufficient.
|
|
15
|
+
- Never manipulate temporary worktrees, leases, or containers directly; only call `ai task validate`.
|
|
16
|
+
- Never record tokens, environment variables, full argv, absolute user paths, or raw transcripts in the artifact.
|
|
17
|
+
|
|
18
|
+
## Step 0: State Check (pre-execution hard gate)
|
|
19
|
+
|
|
20
|
+
Resolve the task reference, then run this command and copy its original output into the artifact:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
agent-infra-internal task-snapshot {task-id} --format text
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Steps
|
|
27
|
+
|
|
28
|
+
1. Resolve `{task-ref}`, the validation target, and the command after the literal `--`; stop without writing an artifact if any is missing.
|
|
29
|
+
2. Run `agent-infra-internal task-artifact {task-id} inspect --family validation-run`, take the round and artifact name from the core result, then run `agent-infra-internal task-event {task-id} validation-run.started --agent {standard-agent-token}`.
|
|
30
|
+
3. Use snapshot for fixed-commit checks and inplace for uncommitted content, original mounts, or original permissions; when uncertain, start with snapshot and upgrade only with evidence.
|
|
31
|
+
4. Call `ai task validate {task-ref} --scope {scope} --format json -- {command...}`. A runtime upgrade must be a second explicit inplace call with its reason recorded.
|
|
32
|
+
5. Read `reference/report-template.md`, create `validation-run.md|validation-run-r{N}.md`, and record only the CLI JSON allowlist and a sanitized summary.
|
|
33
|
+
6. Run `agent-infra-internal task-event {task-id} validation-run.completed --agent {standard-agent-token} --artifact {artifact}`. When an Issue exists, run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` and then `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {artifact} --agent {standard-agent-token}`.
|
|
34
|
+
7. Run `agent-infra-internal task-verify {task-id} validation-run.completed --artifact {artifact} --format text`; fix failures and rerun it.
|
|
35
|
+
8. Report the evidence path, coverage gaps, and verification result; explicitly leave the decision to run `complete-manual-validation` to the maintainer. Read `.agents/rules/next-step-output.md` and end with `Completed at`.
|
|
36
|
+
|
|
37
|
+
## Completion Checklist
|
|
38
|
+
|
|
39
|
+
- [ ] Used `ai task validate`
|
|
40
|
+
- [ ] Recorded sanitized validation-run evidence
|
|
41
|
+
- [ ] Did not change PR manual validation completion state
|
|
42
|
+
- [ ] Updated task.md and passed completion verification
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: run-manual-validation
|
|
3
|
+
description: >
|
|
4
|
+
在宿主机安全运行任务人工校验并记录标准证据。
|
|
5
|
+
当校验依赖宿主权限、真实容器或原位工作树状态时使用。
|
|
6
|
+
仅当对话包含可解析的任务引用时才可自动调用本技能。
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 运行人工校验
|
|
10
|
+
|
|
11
|
+
## 行为边界
|
|
12
|
+
|
|
13
|
+
- 本技能负责选择校验模式、调用唯一机械入口并记录证据;不把 PR 人工校验标为完成。
|
|
14
|
+
- `complete-manual-validation` 仍是维护者确认覆盖充分后的最终登记入口。
|
|
15
|
+
- 禁止直接操作临时 worktree、lease 或 container;只调用 `ai task validate`。
|
|
16
|
+
- 产物不得记录 token、环境变量、完整 argv、绝对用户路径或原始 transcript。
|
|
17
|
+
|
|
18
|
+
## 第 0 步:状态核对(执行前硬约束)
|
|
19
|
+
|
|
20
|
+
解析任务引用后运行,并把原文写入产物:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
agent-infra-internal task-snapshot {task-id} --format text
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 执行步骤
|
|
27
|
+
|
|
28
|
+
1. 解析 `{task-ref}`、验证目标和 `--` 后的命令;缺失时停止,不写产物。
|
|
29
|
+
2. 运行 `agent-infra-internal task-artifact {task-id} inspect --family validation-run`,从核心结果取得轮次和产物名;随后运行 `agent-infra-internal task-event {task-id} validation-run.started --agent {standard-agent-token}`。
|
|
30
|
+
3. 选择模式:固定提交只查用 snapshot;依赖未提交内容、原挂载或原位权限用 inplace;不确定时先 snapshot,只有证据表明必须原位时才升级。
|
|
31
|
+
4. 调用 `ai task validate {task-ref} --scope {scope} --format json -- {command...}`。运行时升级必须作为第二次显式 inplace 调用,并记录理由。
|
|
32
|
+
5. 读取 `reference/report-template.md`,创建 `validation-run.md|validation-run-r{N}.md`;只写 CLI JSON allowlist 与去敏摘要。
|
|
33
|
+
6. 运行 `agent-infra-internal task-event {task-id} validation-run.completed --agent {standard-agent-token} --artifact {artifact}`。存在 Issue 时依次运行 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` 和 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {artifact} --agent {standard-agent-token}`。
|
|
34
|
+
7. 运行 `agent-infra-internal task-verify {task-id} validation-run.completed --artifact {artifact} --format text`;未通过则修复后重跑。
|
|
35
|
+
8. 告知用户证据路径、覆盖缺口和验证结果;明确仍需维护者判断是否执行 `complete-manual-validation`。读取 `.agents/rules/next-step-output.md`,最后一行输出 `Completed at`。
|
|
36
|
+
|
|
37
|
+
## 完成检查清单
|
|
38
|
+
|
|
39
|
+
- [ ] 已使用 `ai task validate`
|
|
40
|
+
- [ ] 已记录去敏 validation-run 证据
|
|
41
|
+
- [ ] 未修改 PR 人工验证完成状态
|
|
42
|
+
- [ ] 已更新 task.md 并通过完成校验
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "run-manual-validation",
|
|
3
|
+
"checks": {
|
|
4
|
+
"task-meta": { "required_fields": ["id", "type", "workflow", "status", "created_at", "updated_at", "agent_infra_version", "current_step", "assigned_to"] },
|
|
5
|
+
"artifact": {
|
|
6
|
+
"file_pattern": "validation-run.md|validation-run-r{N}.md",
|
|
7
|
+
"required_sections": ["State Check", "Validation Target", "Mode Decision", "Command Summary", "Structured Evidence", "Cleanup and Recovery", "Remaining Coverage", "Raw Evidence"],
|
|
8
|
+
"required_patterns": ["^\\$ "]
|
|
9
|
+
},
|
|
10
|
+
"activity-log": { "expected_action_pattern": "Run Manual Validation \\(Round \\d+\\)" },
|
|
11
|
+
"review-ledger": { "stage_scope": ["analysis", "plan", "code"] },
|
|
12
|
+
"platform-sync": { "when": "issue_number_exists", "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->", "verify_comment_content": true, "verify_task_comment_content": true, "verify_issue_type": true, "verify_issue_fields": false, "verify_milestone": true, "expected_comment_marker_key": "artifact" }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "run-manual-validation",
|
|
3
|
+
"checks": {
|
|
4
|
+
"task-meta": { "required_fields": ["id", "type", "workflow", "status", "created_at", "updated_at", "agent_infra_version", "current_step", "assigned_to"] },
|
|
5
|
+
"artifact": {
|
|
6
|
+
"file_pattern": "validation-run.md|validation-run-r{N}.md",
|
|
7
|
+
"required_sections": ["状态核对", "验证目标", "模式判定", "命令摘要", "结构化证据", "清理与恢复", "尚未覆盖", "证据原文"],
|
|
8
|
+
"required_patterns": ["^\\$ "]
|
|
9
|
+
},
|
|
10
|
+
"activity-log": { "expected_action_pattern": "Run Manual Validation \\(Round \\d+\\)" },
|
|
11
|
+
"review-ledger": { "stage_scope": ["analysis", "plan", "code"] },
|
|
12
|
+
"platform-sync": { "when": "issue_number_exists", "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->", "verify_comment_content": true, "verify_task_comment_content": true, "verify_issue_type": true, "verify_issue_fields": false, "verify_milestone": true, "expected_comment_marker_key": "artifact" }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Validation Run Evidence
|
|
2
|
+
|
|
3
|
+
## State Check
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
$ agent-infra-internal task-snapshot {task-id} --format text
|
|
7
|
+
{raw-output}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Validation Target
|
|
11
|
+
|
|
12
|
+
{target-and-coverage}
|
|
13
|
+
|
|
14
|
+
## Mode Decision
|
|
15
|
+
|
|
16
|
+
- Mode: `{snapshot|inplace}`
|
|
17
|
+
- Reason: {reason}
|
|
18
|
+
- Runtime upgrade: {none-or-reason}
|
|
19
|
+
|
|
20
|
+
## Command Summary
|
|
21
|
+
|
|
22
|
+
- Command name: `{basename-only}`
|
|
23
|
+
- Do not record full argv, environment variables, or raw output.
|
|
24
|
+
|
|
25
|
+
## Structured Evidence
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{sanitized-ai-task-validate-json}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Cleanup and Recovery
|
|
32
|
+
|
|
33
|
+
{cleanup-and-recovery-result}
|
|
34
|
+
|
|
35
|
+
## Remaining Coverage
|
|
36
|
+
|
|
37
|
+
{remaining-manual-validation-items}
|
|
38
|
+
|
|
39
|
+
## Raw Evidence
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
$ ai task validate {task-ref} --scope {scope} --format json -- {redacted-command}
|
|
43
|
+
{sanitized-result}
|
|
44
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# 验证运行证据
|
|
2
|
+
|
|
3
|
+
## 状态核对
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
$ agent-infra-internal task-snapshot {task-id} --format text
|
|
7
|
+
{raw-output}
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## 验证目标
|
|
11
|
+
|
|
12
|
+
{target-and-coverage}
|
|
13
|
+
|
|
14
|
+
## 模式判定
|
|
15
|
+
|
|
16
|
+
- 模式:`{snapshot|inplace}`
|
|
17
|
+
- 依据:{reason}
|
|
18
|
+
- 运行时升级:{none-or-reason}
|
|
19
|
+
|
|
20
|
+
## 命令摘要
|
|
21
|
+
|
|
22
|
+
- 命令名称:`{basename-only}`
|
|
23
|
+
- 不记录完整 argv、环境变量或原始输出。
|
|
24
|
+
|
|
25
|
+
## 结构化证据
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{sanitized-ai-task-validate-json}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 清理与恢复
|
|
32
|
+
|
|
33
|
+
{cleanup-and-recovery-result}
|
|
34
|
+
|
|
35
|
+
## 尚未覆盖
|
|
36
|
+
|
|
37
|
+
{remaining-manual-validation-items}
|
|
38
|
+
|
|
39
|
+
## 证据原文
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
$ ai task validate {task-ref} --scope {scope} --format json -- {redacted-command}
|
|
43
|
+
{sanitized-result}
|
|
44
|
+
```
|
|
@@ -12,8 +12,8 @@ The orchestrator delegates only and never executes a stage skill itself. First r
|
|
|
12
12
|
1. Resolve the task, current Agent Client, and optional atomic policy flags `--executor-model`, `--executor-reasoning-effort`, `--reviewer-model`, and `--reviewer-reasoning-effort`, then run `task-snapshot`. If any explicit policy flag is present, all four role fields are required and must not be merged with configuration; both roles may use the same model.
|
|
13
13
|
2. Run `task-orchestration {task-id} begin-or-resume --client {client}` with the complete explicit policy. With no explicit policy, core reads only that client's `agentClients[].orchestration`; an existing v2 run uses its persisted policy. Only on `ORCHESTRATION_MODEL_POLICY_REQUIRED`, show the complete/partial/interactive-only `agent-client model-selection` context and collect one complete policy; no answer means no run is created. Stop on paused/completed results.
|
|
14
14
|
3. Run `route` and read its structured result. On `completed`, immediately run `agent-infra-internal task-verify {task-id} run-task.completed --format text` and stop. Only when the result is `running` with a non-null `next`, use its single action, role, round, artifact, `requestedModel`, and `requestedReasoningEffort`; never infer them from review prose, session defaults, or a partial tool schema.
|
|
15
|
-
4. Only for the `running` result from step 3, run `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort}` so core validates both fields and host evidence before snapshotting. Claude Code's native start event
|
|
16
|
-
5.
|
|
15
|
+
4. Only for the `running` result from step 3, run `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort}` so core validates both fields and host evidence before snapshotting. Codex also validates the CLI, features, hook trust/discovery, and App Server schema first; a failed preflight creates neither a receipt nor a workspace baseline. Claude Code's native start event still cannot provide stable actual model/effort evidence and returns `ORCHESTRATION_CLIENT_UNSUPPORTED`. Only after validation succeeds, start a fresh native child with the same model/effort overrides and only the short task ref, skill name, literal `--orchestrated` execution marker, and minimal handoff. The child must forward that marker to every provenance-sensitive command in the stage.
|
|
16
|
+
5. Codex prefers SubagentStart/Stop plus App Server actual evidence to activate, consume, and seal the unique receipt. When a custom role does not emit native start/stop, trusted parent PostTool spawn uniquely resolves the child from rollout evidence and a completed wait validates the terminal before idempotent sealing. Timed-out waits do nothing; only empty turns or protocol `inProgress` may wait, while malformed, identity/transport errors, or abnormal terminals pause. Other supported clients keep native start/stop correlation. After the child returns, run `advance` only for a sealed receipt. Repeat step 3 only for `running`; stop immediately for `paused` or `completed`.
|
|
17
17
|
6. Create a new child every round and never follow up with an old reviewer. Native start must report actual model and actual reasoning effort; each requested/actual mismatch needs its own host fallback reason, and requested values must never be fabricated as actual evidence. Capability, hook, identity, evidence, ledger, or fingerprint failures must call `pause` and fail closed.
|
|
18
18
|
7. On pause or completion, run the matching typed verification and report the structured run summary, pause reason, commit endpoint, or clean completion evidence.
|
|
19
19
|
|
|
@@ -12,8 +12,8 @@ description: >
|
|
|
12
12
|
1. 解析任务引用、当前 Agent Client,以及可选的原子策略 `--executor-model`、`--executor-reasoning-effort`、`--reviewer-model`、`--reviewer-reasoning-effort`,并执行 `agent-infra-internal task-snapshot {task-id} --format text`。任一显式策略字段出现时四个 role 字段必须完整,不得与配置拼接;两个角色可以使用同一模型。
|
|
13
13
|
2. 调用 `agent-infra-internal task-orchestration {task-id} begin-or-resume --client {client}` 并转发完整显式策略。完全没有显式策略时由核心读取当前 client 的 `agentClients[].orchestration`;已有 v2 run 使用持久化策略。仅当核心返回 `ORCHESTRATION_MODEL_POLICY_REQUIRED` 时,先用 `agent-client model-selection` 展示 complete/partial/interactive-only 来源,再一次收集完整策略;未回答则不创建 run。若为 paused/completed,按结构化结果停止。
|
|
14
14
|
3. 调用 `route` 并读取结构化结果。若返回 `completed`,立即运行 `agent-infra-internal task-verify {task-id} run-task.completed --format text` 并停止;仅当返回 `running` 且 `next` 非空时读取唯一 action、role、round、artifact、`requestedModel` 和 `requestedReasoningEffort`,不得从审查文案、会话默认或局部 tool schema 自行推断。
|
|
15
|
-
4. 仅对步骤 3 的 `running` 结果调用 `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort}
|
|
16
|
-
5.
|
|
15
|
+
4. 仅对步骤 3 的 `running` 结果调用 `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort}`;核心在记录工作区基线前校验两字段与宿主证据能力。Codex 还会先验证 CLI、feature、hook trust/discovery 与 App Server schema;任一 preflight 失败均不得创建 receipt 或工作区基线。当前 Claude Code 的原生 start 事件无法稳定提供 actual model/effort,因此仍返回 `ORCHESTRATION_CLIENT_UNSUPPORTED`。只有校验成功时才用当前客户端的 fresh 原生子 Agent 启动指定角色,并显式覆盖同一 model/effort;只传短任务引用、skill 名、字面执行标记 `--orchestrated` 和最小交接摘要,不传 receipt identity,不继承总控历史。子 Agent 必须把该标记转发给本阶段所有 provenance 敏感命令。
|
|
16
|
+
5. Codex 优先用 SubagentStart/Stop 与 App Server actual evidence 激活、消费并封存唯一 receipt;当 custom role 未投递原生 start/stop 时,受信 parent PostTool spawn 从 rollout 唯一解析 child,completed wait 再验证 terminal 并幂等封存。timed-out wait 无动作;只有 empty turns 或协议 `inProgress` 可等待,malformed、身份/传输错误或异常 terminal 均暂停。其他受支持客户端沿用原生 start/stop hook 关联。子 Agent 返回后只对 sealed receipt 调用 `advance`;只有 `running` 才重复步骤 3,`paused` 或 `completed` 立即停止。
|
|
17
17
|
6. 每轮创建新 child;禁止 follow-up 复用 reviewer。原生 start 必须回传 actual model 与 actual reasoning effort;任一 actual 与 requested 不同时必须有各自的宿主降级理由,缺失时不得用 requested 值补造。任何 capability、hook、身份、证据、账本或 fingerprint 异常都调用 `pause` 并失败关闭。
|
|
18
18
|
7. 完成或暂停后运行对应 typed verification,并把结构化 run 摘要、暂停原因、commit 终点或 clean completion evidence 告知用户。
|
|
19
19
|
|
|
@@ -5,16 +5,16 @@ Before publishing support for a client, prove the lifecycle evidence chain with
|
|
|
5
5
|
## Required Evidence
|
|
6
6
|
|
|
7
7
|
- Client version, enabled multi-agent capability, launch surface, and trust boundary.
|
|
8
|
-
- Raw start/stop events
|
|
8
|
+
- Raw start/stop events, or the parent PostTool spawn/completed-wait fallback when custom roles omit them, stably correlate the managed agent, parent/child identity, fresh spawn mode, actual model, and actual reasoning effort.
|
|
9
9
|
- Explicit requested model/effort reaches each executor/reviewer. A fallback of either field reports the corresponding actual value and its own non-empty reason.
|
|
10
10
|
- Candidate-checkout and packed-install behavior match, with model policy, receipts, and verification results auditable in `orchestration.json`.
|
|
11
11
|
|
|
12
12
|
## Validation Sequence
|
|
13
13
|
|
|
14
14
|
1. Record client version, feature state, and launch command in a clean temporary repository.
|
|
15
|
-
2. Start a fresh executor and reviewer, retaining redacted raw stdin and the structured run. Never synthesize a field the host did not emit.
|
|
15
|
+
2. Start a fresh executor and reviewer, retaining redacted raw stdin and the structured run. Validate both native start/stop and the parent PostTool fallback; timed-out waits must do nothing. Never synthesize a field the host did not emit.
|
|
16
16
|
3. Validate model/effort match paths, single and dual justified fallbacks, and fail-closed behavior for missing actual fields.
|
|
17
17
|
4. Validate the same commit from a candidate checkout and an `npm pack` install; record the tarball hash and results.
|
|
18
18
|
5. Commit only redacted summaries and non-sensitive fixtures. Remove or replace tokens, user-specific absolute paths, transcript content, and credentials.
|
|
19
19
|
|
|
20
|
-
If any required field cannot be observed reliably from the real host, keep that client's orchestration capability `unsupported` and record the gap as manual validation.
|
|
20
|
+
If any required field cannot be observed reliably from the real host, keep that client's orchestration capability `unsupported` and record the gap as manual validation. Codex may advertise `experimental`, but every `prepare` must still pass static preflight and either native start/stop or the parent spawn/completed-wait fallback must produce verifiable consumed host evidence. The fallback may wait only for empty turns or protocol `inProgress`; malformed, identity/transport errors, or abnormal terminals pause deterministically.
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
## 必须证明的字段
|
|
6
6
|
|
|
7
7
|
- 客户端版本、启用的多代理能力、启动入口与信任边界。
|
|
8
|
-
- 原始 start/stop
|
|
8
|
+
- 原始 start/stop 事件,或 custom role 缺少它们时的 parent PostTool spawn/completed-wait fallback,能稳定关联 managed agent、parent/child identity、fresh spawn mode、actual model 和 actual reasoning effort。
|
|
9
9
|
- 显式 requested model/effort 能传给 executor/reviewer;宿主对任一字段回退时,事件能给出对应 actual 值与独立的非空 fallback reason。
|
|
10
10
|
- candidate checkout 与打包安装后的行为一致,且模型策略、receipt 与验证结果可从 `orchestration.json` 复核。
|
|
11
11
|
|
|
12
12
|
## 验证顺序
|
|
13
13
|
|
|
14
14
|
1. 在干净临时仓库记录客户端版本、feature 状态和启动命令。
|
|
15
|
-
2. 分别启动 fresh executor 与 fresh reviewer,保存去敏后的原始 stdin 和结构化 run
|
|
15
|
+
2. 分别启动 fresh executor 与 fresh reviewer,保存去敏后的原始 stdin 和结构化 run;同时验证原生 start/stop 与 parent PostTool fallback。timed-out wait 必须无动作;不得补写宿主未产生的字段。
|
|
16
16
|
3. 分别验证 model/effort 的 requested/actual 一致路径、单项与双项有理由 fallback 路径,并确认缺 actual 字段会失败关闭。
|
|
17
17
|
4. 对同一 commit 执行 candidate checkout 与 `npm pack` 安装验证,记录 tarball 哈希和结果。
|
|
18
18
|
5. 仅把去敏摘要与非敏感 fixture 纳入版本库;token、绝对用户路径、transcript 内容和凭证必须删除或替换。
|
|
19
19
|
|
|
20
|
-
任一字段无法从真实宿主稳定观察时,该客户端的 orchestration capability 保持 `unsupported`,并把缺口记录为人工验证项。
|
|
20
|
+
任一字段无法从真实宿主稳定观察时,该客户端的 orchestration capability 保持 `unsupported`,并把缺口记录为人工验证项。Codex 可声明为 `experimental`,但每次 `prepare` 仍必须通过静态 preflight,且原生 start/stop 或 parent spawn/completed-wait fallback 必须形成可验证的 consumed host evidence。fallback 只允许 empty turns/协议 `inProgress` 等待;malformed、身份/传输错误或异常 terminal 都稳定暂停。
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Run host-side task validation and record sanitized evidence"
|
|
3
|
+
usage: "/run-manual-validation <task-ref> [--scope snapshot|inplace] [--timeout <ms>] [--format text|json] -- <command...>"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Read and execute the run-manual-validation skill from `.agents/skills/run-manual-validation/SKILL.md`.
|
|
8
|
+
|
|
9
|
+
Follow all steps defined in the skill exactly.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "运行宿主侧任务校验并记录去敏证据"
|
|
3
|
+
usage: "/run-manual-validation <task-ref> [--scope snapshot|inplace] [--timeout <ms>] [--format text|json] -- <command...>"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
读取并执行 `.agents/skills/run-manual-validation/SKILL.md` 中的 run-manual-validation 技能。
|
|
8
|
+
|
|
9
|
+
严格按照技能中定义的所有步骤执行。
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
|
|
16
|
+
"matcher": "^collaborationspawn_agent$",
|
|
17
17
|
"hooks": [
|
|
18
18
|
{
|
|
19
19
|
"type": "command",
|
|
20
20
|
"command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event pre-tool",
|
|
21
|
-
"timeout":
|
|
21
|
+
"timeout": 15,
|
|
22
22
|
"statusMessage": "Recording Codex lifecycle spawn evidence"
|
|
23
23
|
}
|
|
24
24
|
]
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
],
|
|
27
27
|
"PostToolUse": [
|
|
28
28
|
{
|
|
29
|
-
|
|
29
|
+
"matcher": "",
|
|
30
30
|
"hooks": [
|
|
31
31
|
{
|
|
32
32
|
"type": "command",
|
|
33
33
|
"command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event post-tool",
|
|
34
|
-
"timeout":
|
|
34
|
+
"timeout": 15,
|
|
35
35
|
"statusMessage": "Recording Codex lifecycle tool completion"
|
|
36
36
|
}
|
|
37
37
|
]
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
],
|
|
40
40
|
"SubagentStart": [
|
|
41
41
|
{
|
|
42
|
-
"matcher": "
|
|
42
|
+
"matcher": "",
|
|
43
43
|
"hooks": [
|
|
44
44
|
{
|
|
45
45
|
"type": "command",
|
|
46
46
|
"command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event subagent-start",
|
|
47
|
-
"timeout":
|
|
47
|
+
"timeout": 15,
|
|
48
48
|
"statusMessage": "Recording Codex child identity"
|
|
49
49
|
}
|
|
50
50
|
]
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
],
|
|
53
53
|
"SubagentStop": [
|
|
54
54
|
{
|
|
55
|
-
"matcher": "
|
|
55
|
+
"matcher": "",
|
|
56
56
|
"hooks": [
|
|
57
57
|
{
|
|
58
58
|
"type": "command",
|
|
59
59
|
"command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event subagent-stop",
|
|
60
|
-
"timeout":
|
|
60
|
+
"timeout": 15,
|
|
61
61
|
"statusMessage": "Recording Codex child stop evidence"
|
|
62
62
|
}
|
|
63
63
|
]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Run host-side task validation and record sanitized evidence"
|
|
3
|
+
agent: general
|
|
4
|
+
subtask: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Run manual validation: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Read and execute the run-manual-validation skill from `.agents/skills/run-manual-validation/SKILL.md`.
|
|
10
|
+
|
|
11
|
+
Follow all steps defined in the skill exactly.
|