feat: define scheduler handoff v4 artifact - #11
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds scheduler handoff v4 support to agentcli by introducing an immutable, content-addressed “handoff artifact” (plus shared conformance fixtures), extending compilation/apply to negotiate v4 only when the runtime advertises the required capabilities, and adding proof/evidence verification hooks and stronger release CI/package contract checks.
Changes:
- Introduce handoff v4 artifact generation + validation, shared conformance fixture, and extensive tests covering determinism/tamper-evidence, credential presentation mapping, apply semantics, and proof verification.
- Extend scheduler field projection/version negotiation to include v4 fields and update feature/capability handling, targets baseline, and inspect surface for new immutable runtime entities.
- Harden release/CI with fixture parity checks and a packaged-artifact verification script; update docs/changelog for v4 and version bump to
0.5.0.
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/integration-scheduler.test.js | Updates expected negotiated handoff field version to allow v4. |
| test/handoff-v4.test.js | Adds end-to-end tests for v4 artifact determinism, apply behavior, credential presentation, and proof verification. |
| test/agentcli.test.js | Updates feature baseline assertions and adjusts proof value_from shape expectations. |
| src/targets.js | Expands openclaw-scheduler feature baseline to include v4-related capabilities. |
| src/scheduler-fields.js | Adds v4 scheduler fields and registers them under field version 4. |
| src/inspect.js | Adds new inspect entities (evidence, artifacts, events, provider sessions, credential presentations). |
| src/handoff/v4.js | Implements v4 artifact builder + validator (canonicalization, bindings, and safety checks). |
| src/handoff/index.js | Exposes the v4 handoff module entrypoint via a stable index. |
| src/evidence/payload.js | Extends evidence bindings and binding validation to include artifact/run lineage fields. |
| src/evidence/index.js | Adds optional verification-time binding check against an audit record. |
| src/compiler/openclaw-scheduler.js | Adds schedulerHandoffVersion support and emits v4 artifact fields when enabled. |
| src/capabilities.js | Adds v4 required-feature list and helper to determine v4 support; adds v4 capability checks for v4 jobs. |
| src/authorization-proof/jwt.js | Tightens v4 JWT requirements (artifact binding, exp/iat/jti, replay + revocation hooks). |
| src/authorization-proof/detached-signature.js | Adds v4 detached-signature envelope/signing content + replay/revocation guards and artifact binding. |
| src/authorization-proof/certificate.js | Adds v4 certificate envelope/signing content + replay/revocation guards and artifact binding. |
| src/apply.js | Adds v4 negotiation path, v4 field projection support, and includes artifact payload as a JSON blob field. |
| scripts/verify-package.mjs | Adds a package-contract verification script (pack/extract checks + required/forbidden paths). |
| README.md | Documents expanded inspect entities and updates openclaw-scheduler target description for v4. |
| package.json | Bumps version to 0.5.0, adds exports for new modules, includes fixtures/scripts in package, adds verify:package. |
| package-lock.json | Updates lockfile version fields to match 0.5.0. |
| fixtures/handoff-v4/conformance.json | Adds shared positive/negative conformance fixture for v4 artifact parity. |
| docs/versioning.md | Updates documented package version to 0.5.0. |
| docs/spec.md | Adds scheduler handoff v4 specification section (artifact contract, runtime gates, compatibility). |
| docs/runtime-integration-backlog.md | Marks v4 handoff work as delivered and updates status wording. |
| docs/roadmap.md | Updates roadmap to reference v4 handoff and its capabilities. |
| docs/protocol.md | Updates example outputs/handshake docs to include v0.5.0 and handoff field version 4. |
| docs/adoption.md | Updates adoption doc to reference capability negotiation through handoff v4. |
| CHANGELOG.md | Adds release notes for 0.5.0 summarizing v4 handoff, proofs, evidence, inspect, and fixtures. |
| .github/workflows/publish.yml | Hardens publish pipeline (exact-main gate, main CI success gate, fixture parity, package verification, pinned actions). |
| .github/workflows/ci.yml | Adds fixture parity + package verification to CI and pins actions versions/refs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1405312070
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@copilot review |
|
@codex review |
Review summary for the current HEAD ( The PR is in good shape. Here are my findings: Previously flagged issue — resolved ✅ No new issues found
The implementation is correct and the security-sensitive paths (proof verification, credential presentation, v4 gating) all fail closed. |
There was a problem hiding this comment.
💡 Codex Review
Line 449 in cd1298a
When a stable job has a non-system origin—most notably after the new adopt-by-name path preserves a legacy origin—a subsequent apply compiles the replacement artifact against origin: "system", while schedulerUpdateSpec deliberately removes origin from the update. The stored job therefore retains its legacy origin but receives a scheduler_job_binding.digest calculated for a different origin, causing v4 binding validation to reject the update or prevent dispatch. Rebind the v4 artifact using the existing row's origin before calling updateJob.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@copilot review @codex review Please review exact head cce0e40. This head addresses every prior inline thread and the top-level origin-preservation finding: valid on-failure cleanup, fail-closed proof method validation, mandatory v4 certificate proof of possession, safe rejection of v4 runtime downgrades, and exact existing-origin rebinding on updates. Local gates: 806/806 tests, lint, package verification, and npm audit all pass. |
Review of All five claimed fixes are correct and well-tested:
794/794 tests pass. No issues found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cce0e4066b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@copilot review @codex review Please review final exact head 656abee. The only change since the clean cce0e40 exact-head code review is immutable CI/publish pinning to fully reviewed and green openclaw-scheduler bb9dae60270d2945bec62403bc6f08adc7c50ec8. Local cross-repo gate: 806/806 tests, 12/12 scheduler integration, lint, package verification, fixture parity, and npm audit all pass. |
Review of The only change from the previously clean 794/794 tests pass. No issues found. |
|
To use Codex here, create a Codex account and connect to github. |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review Please review exact head 3d710f3. Focus on exact v4 capability contracts, proof digest canonicalization, precompile delegated negotiation and one-off binding, canonical persisted JSON, evidence declaration parity, and v4 evidence lineage. Hosted CI and all local release gates pass; all current review threads are resolved. |
Review of All six changes are correct and well-tested. 1. Canonical JSON blob serialization for v4 (
2. Exact v4 runtime contract (
3. Precompile delegated v4 negotiation and one-off binding ( Capability negotiation is moved before 4. Canonical persisted JSON in
5. V4 evidence declaration lineage (
Additionally, 6. Canonical artifact digest format for JWT bindings (
7.
No issues found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d710f31df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Review of 810/810 tests pass. CI is green. All six changes are correct and well-tested. 1. Centralized The new helper tightens the prior 2. Canonical SHA-256 enforcement in certificate and detached-signature verifiers Both verifiers now introduce a 3. The prior 4. Evidence
5. The refactor correctly separates 6. v4 evidence records now require both fields to be present as non-empty strings (for No issues found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c859782da
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
amittell
left a comment
There was a problem hiding this comment.
Submitting the accumulated inline resolution evidence for the v4 review fixes; each addressed thread cites its exact implementation commit and regression gates.
amittell
left a comment
There was a problem hiding this comment.
Submitting the remaining accumulated inline resolution evidence for the v4 discovery fixes.
Review of 810/810 tests pass. CI is green. Both changes are correct and well-tested. 1. v4-scoped The The result now exposes three distinct fields:
2. Non-array
No issues found. |
|
To use Codex here, create a Codex account and connect to github. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@copilot review exact head 24e25dd. This pin-only release follow-up changes the three AgentCLI CI/publish acceptance sites to final stable Scheduler dbd353e9eef4342fe4b5cdeb63e2ffa2006a5119. Local lint, 822/822 tests including exact Scheduler integration 12/12, fixture byte parity, package verification, npm audit 0, diff check, and independent review are green. |
|
@codex review exact head 24e25dd. This pin-only release follow-up changes the three AgentCLI CI/publish acceptance sites to final stable Scheduler dbd353e9eef4342fe4b5cdeb63e2ffa2006a5119. Local lint, 822/822 tests including exact Scheduler integration 12/12, fixture byte parity, package verification, npm audit 0, diff check, and independent review are green. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@copilot review |
Summary
Validation
Paired release heads:
Companion to amittell/openclaw-scheduler#19.