Skip to content

Commit 0f2a76a

Browse files
committed
Local snapshot: add phase 5d startup readiness contract
1 parent 8292b09 commit 0f2a76a

5 files changed

Lines changed: 361 additions & 9 deletions

File tree

.agents/skills/ctxt-antigravity-runtime/SKILL.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Use these commands first to inspect the shared contract and runtime surface:
2929

3030
```powershell
3131
cargo run --bin ctxt -- --json self report
32+
cargo run --bin ctxt -- --json startup readiness
3233
cargo run --bin ctxt -- --json startup flow
3334
cargo run --bin ctxt -- --json schema
3435
cargo run --bin ctxt -- --json capabilities
@@ -98,6 +99,14 @@ The startup flow is a contract-only checklist. It does not run commands automati
9899

99100
Agents remain responsible for executing allowed commands one by one only when the active phase permits those commands. Use official docs only for architecture or best-practice claims.
100101

102+
# Startup Readiness Contract
103+
104+
Agents should call `ctxt --json startup readiness` before starting review workflow work.
105+
106+
Readiness is a contract-only report. It does not run commands automatically. `ready_for_review_workflow: true` does not imply external execution is allowed. `ready_for_external_execution: false` remains the hard boundary.
107+
108+
Use official docs only for architecture and best-practice claims.
109+
101110
# Plan Artifacts Only
102111

103112
For Antigravity plan artifacts only, use:

.agents/skills/ctxt-runtime/SKILL.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Use these commands for safe, JSON-oriented runtime inspection:
6464

6565
```powershell
6666
cargo run --bin ctxt -- --json self report
67+
cargo run --bin ctxt -- --json startup readiness
6768
cargo run --bin ctxt -- --json startup flow
6869
cargo run --bin ctxt -- --json agent list
6970
cargo run --bin ctxt -- --json agent discover
@@ -174,6 +175,14 @@ Agents should call `ctxt --json startup flow` to discover the safe session start
174175

175176
Agents remain responsible for executing allowed commands one by one only when the active phase permits those commands. Use official docs only for architecture or best-practice claims.
176177

178+
# Phase 5d Note
179+
180+
Phase 5d adds a deterministic startup readiness contract through `ctxt --json startup readiness`.
181+
182+
Agents should call `ctxt --json startup readiness` before starting review workflow work. Readiness is a contract-only report. It does not run commands automatically.
183+
184+
`ready_for_review_workflow: true` does not imply external execution is allowed. `ready_for_external_execution: false` remains the hard boundary. Use official docs only for architecture and best-practice claims.
185+
177186
# Cross-Agent Compatibility
178187

179188
Codex and Antigravity should both route through `ctxt`.

docs/AGENT_RUNTIME_CLI.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,16 @@ The startup flow is a contract-only checklist. It does not execute the flow, inv
224224

225225
External tools may use `ctxt --json startup flow` as a deterministic startup checklist. They remain responsible for executing allowed commands one by one only when the active phase permits those commands.
226226

227+
## Phase 5d Behavior
228+
229+
Phase 5d adds a deterministic startup readiness contract.
230+
231+
`ctxt --json startup readiness` returns a static readiness report for the deterministic review workflow. It reports that review workflow contracts are ready and that external execution remains disabled.
232+
233+
The readiness report is not an execution gate. It does not execute commands, invoke Codex CLI, invoke Antigravity CLI, invoke external agents, use network, execute subagents, apply proposals, apply review recommendations, or perform git writes.
234+
235+
External tools may use `ctxt --json startup readiness` to decide whether the deterministic review workflow is available. `ready_for_review_workflow: true` does not imply external execution is allowed; `ready_for_external_execution: false` remains the hard boundary.
236+
227237
## Future Phases
228238

229239
Later phases may add real Codex CLI or Antigravity CLI invocation behind explicit gates. Those phases should preserve the run artifact, keep JSON output machine-readable, and record provenance before and after external execution.

src/cli.rs

Lines changed: 155 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ enum Command {
107107
Schema,
108108
SelfReport,
109109
StartupFlow,
110+
StartupReadiness,
110111
SubagentsList,
111112
RunsList,
112113
RunsRead {
@@ -407,6 +408,13 @@ where
407408
1
408409
}
409410
},
411+
Ok(Command::StartupReadiness) => match handle_startup_readiness(json_output) {
412+
Ok(_) => 0,
413+
Err(e) => {
414+
emit_error(json_output, &e);
415+
1
416+
}
417+
},
410418
Ok(Command::SubagentsList) => match handle_subagents_list(json_output) {
411419
Ok(_) => 0,
412420
Err(e) => {
@@ -1046,7 +1054,9 @@ fn parse_subagents_command(argv: &[String]) -> Result<Command, String> {
10461054

10471055
fn parse_startup_command(argv: &[String]) -> Result<Command, String> {
10481056
if argv.len() < 2 {
1049-
return Err("missing subcommand for 'startup'. Usage: ctxt startup flow".to_string());
1057+
return Err(
1058+
"missing subcommand for 'startup'. Usage: ctxt startup flow | readiness".to_string(),
1059+
);
10501060
}
10511061

10521062
match argv[1].as_str() {
@@ -1059,8 +1069,17 @@ fn parse_startup_command(argv: &[String]) -> Result<Command, String> {
10591069
}
10601070
Ok(Command::StartupFlow)
10611071
}
1072+
"readiness" => {
1073+
if argv.len() > 2 {
1074+
return Err(format!(
1075+
"unexpected argument '{}' for 'startup readiness'",
1076+
argv[2]
1077+
));
1078+
}
1079+
Ok(Command::StartupReadiness)
1080+
}
10621081
"run" | "execute" => Err(format!(
1063-
"unsupported subcommand '{}' for 'startup': startup flow execution is not supported",
1082+
"unsupported subcommand '{}' for 'startup': startup command execution is not supported",
10641083
argv[1]
10651084
)),
10661085
other => Err(format!("unsupported subcommand '{}' for 'startup'", other)),
@@ -2925,48 +2944,55 @@ fn handle_startup_flow(_json_output: bool) -> Result<(), String> {
29252944
"recommended_sequence": [
29262945
{
29272946
"order": 1,
2947+
"command": "ctxt --json startup readiness",
2948+
"purpose": "confirm deterministic review workflow readiness without enabling external execution",
2949+
"required": true,
2950+
"executes": false
2951+
},
2952+
{
2953+
"order": 2,
29282954
"command": "ctxt --json self report",
29292955
"purpose": "read local runtime baseline and safe entrypoints",
29302956
"required": true,
29312957
"executes": false
29322958
},
29332959
{
2934-
"order": 2,
2960+
"order": 3,
29352961
"command": "ctxt --json schema",
29362962
"purpose": "read stable JSON command and artifact contracts",
29372963
"required": true,
29382964
"executes": false
29392965
},
29402966
{
2941-
"order": 3,
2967+
"order": 4,
29422968
"command": "ctxt --json capabilities",
29432969
"purpose": "read supported features and disabled gates",
29442970
"required": true,
29452971
"executes": false
29462972
},
29472973
{
2948-
"order": 4,
2974+
"order": 5,
29492975
"command": "ctxt --json subagents list",
29502976
"purpose": "read deterministic review and planning role contracts",
29512977
"required": true,
29522978
"executes": false
29532979
},
29542980
{
2955-
"order": 5,
2981+
"order": 6,
29562982
"command": "ctxt --json proposals list",
29572983
"purpose": "list local proposal artifact references without applying them",
29582984
"required": true,
29592985
"executes": false
29602986
},
29612987
{
2962-
"order": 6,
2988+
"order": 7,
29632989
"command": "ctxt --json reviews list",
29642990
"purpose": "list local review artifact references without generating or applying reviews",
29652991
"required": true,
29662992
"executes": false
29672993
},
29682994
{
2969-
"order": 7,
2995+
"order": 8,
29702996
"command": "ctxt --json validate --run",
29712997
"purpose": "run local validation only when the phase permits validation execution",
29722998
"required": true,
@@ -2986,6 +3012,60 @@ fn handle_startup_flow(_json_output: bool) -> Result<(), String> {
29863012
Ok(())
29873013
}
29883014

3015+
fn handle_startup_readiness(_json_output: bool) -> Result<(), String> {
3016+
println!(
3017+
"{}",
3018+
serde_json::json!({
3019+
"ok": true,
3020+
"command": "startup readiness",
3021+
"schema_version": "0.1",
3022+
"ready_for_review_workflow": true,
3023+
"ready_for_external_execution": false,
3024+
"contracts": {
3025+
"self_report": true,
3026+
"schema": true,
3027+
"capabilities": true,
3028+
"subagents": true,
3029+
"proposals": true,
3030+
"reviews": true,
3031+
"startup_flow": true,
3032+
"validation_runner": true
3033+
},
3034+
"disabled_gates": {
3035+
"network": true,
3036+
"external_agents": true,
3037+
"provider_calls": true,
3038+
"proposal_apply": true,
3039+
"review_apply": true,
3040+
"subagent_execution": true,
3041+
"git_write": true,
3042+
"mcp_server": true,
3043+
"hooks": true,
3044+
"plugins": true
3045+
},
3046+
"recommended_next_commands": [
3047+
"ctxt --json startup flow",
3048+
"ctxt --json self report",
3049+
"ctxt --json schema",
3050+
"ctxt --json capabilities",
3051+
"ctxt --json subagents list",
3052+
"ctxt --json proposals list",
3053+
"ctxt --json reviews list",
3054+
"ctxt --json validate --run"
3055+
],
3056+
"safety": {
3057+
"readiness_executed_commands": false,
3058+
"network_used": false,
3059+
"external_agents_invoked": false,
3060+
"subagents_executed": false,
3061+
"apply_performed": false,
3062+
"git_write_performed": false
3063+
}
3064+
})
3065+
);
3066+
Ok(())
3067+
}
3068+
29893069
fn handle_capabilities(_json_output: bool) -> Result<(), String> {
29903070
println!(
29913071
"{}",
@@ -3007,7 +3087,8 @@ fn handle_capabilities(_json_output: bool) -> Result<(), String> {
30073087
{"phase": "4h", "name": "proposal capabilities", "status": "stable"},
30083088
{"phase": "5a", "name": "deterministic subagent role contract", "status": "stable"},
30093089
{"phase": "5b", "name": "deterministic review artifact contract", "status": "stable"},
3010-
{"phase": "5c", "name": "deterministic startup review flow contract", "status": "stable"}
3090+
{"phase": "5c", "name": "deterministic startup review flow contract", "status": "stable"},
3091+
{"phase": "5d", "name": "deterministic startup readiness contract", "status": "stable"}
30113092
],
30123093
"safety": {
30133094
"network_default": "deny",
@@ -3034,6 +3115,10 @@ fn handle_capabilities(_json_output: bool) -> Result<(), String> {
30343115
"review_artifact_contract": true,
30353116
"startup_flow_contract": true,
30363117
"startup_flow_execution": false,
3118+
"startup_readiness_contract": true,
3119+
"startup_readiness_execution": false,
3120+
"ready_for_review_workflow": true,
3121+
"ready_for_external_execution": false,
30373122
"review_generation": false,
30383123
"review_apply": false,
30393124
"proposal_apply": false,
@@ -3138,6 +3223,15 @@ fn handle_capabilities(_json_output: bool) -> Result<(), String> {
31383223
"network_used": false,
31393224
"external_agent_invoked": false,
31403225
"apply_performed": false
3226+
},
3227+
{
3228+
"name": "startup readiness",
3229+
"json": true,
3230+
"side_effects": false,
3231+
"read_only": true,
3232+
"network_used": false,
3233+
"external_agent_invoked": false,
3234+
"apply_performed": false
31413235
}
31423236
]
31433237
})
@@ -3485,6 +3579,53 @@ fn handle_schema(_json_output: bool) -> Result<(), String> {
34853579
"executes"
34863580
]
34873581
},
3582+
{
3583+
"command": "startup readiness",
3584+
"status": "stable",
3585+
"notes": [
3586+
"read-only",
3587+
"static contract",
3588+
"does not execute commands",
3589+
"review workflow readiness only",
3590+
"external execution disabled",
3591+
"no external agents",
3592+
"no network",
3593+
"no apply"
3594+
],
3595+
"required_fields": [
3596+
"ok",
3597+
"command",
3598+
"schema_version",
3599+
"ready_for_review_workflow",
3600+
"ready_for_external_execution",
3601+
"contracts",
3602+
"disabled_gates",
3603+
"recommended_next_commands",
3604+
"safety"
3605+
],
3606+
"contract_fields": [
3607+
"self_report",
3608+
"schema",
3609+
"capabilities",
3610+
"subagents",
3611+
"proposals",
3612+
"reviews",
3613+
"startup_flow",
3614+
"validation_runner"
3615+
],
3616+
"disabled_gate_fields": [
3617+
"network",
3618+
"external_agents",
3619+
"provider_calls",
3620+
"proposal_apply",
3621+
"review_apply",
3622+
"subagent_execution",
3623+
"git_write",
3624+
"mcp_server",
3625+
"hooks",
3626+
"plugins"
3627+
]
3628+
},
34883629
{
34893630
"command": "agent discover",
34903631
"status": "stable",
@@ -3566,6 +3707,7 @@ fn handle_self_report(_json_output: bool) -> Result<(), String> {
35663707
},
35673708
"safe_entrypoints": [
35683709
"ctxt --json schema",
3710+
"ctxt --json startup readiness",
35693711
"ctxt --json startup flow",
35703712
"ctxt --json capabilities",
35713713
"ctxt --json subagents list",
@@ -3589,6 +3731,10 @@ fn handle_self_report(_json_output: bool) -> Result<(), String> {
35893731
"review_artifacts_contract_only": true,
35903732
"startup_flow_execution": false,
35913733
"startup_flow_contract_only": true,
3734+
"startup_readiness_execution": false,
3735+
"startup_readiness_contract_only": true,
3736+
"ready_for_review_workflow": true,
3737+
"ready_for_external_execution": false,
35923738
"network_default": "deny",
35933739
"apply_automatic": false
35943740
},

0 commit comments

Comments
 (0)