@intentic/gate
v1.338.0
Published
Run an intentic release gate from a CI pipeline, POST what the pipeline knows, wait for the run, exit on the verdict
Readme
gate
A small CLI, intentic-gate, that lets any CI pipeline wait on a sandbox release gate's verdict or run an agent turn, and exit on the result.
flowchart LR
ci["CI job"] --> gate(["intentic-gate"])
action["gate-action"] --> gate
gate -->|"POST …/workflows/id/gate"| verdict["Release gate<br/>pass · fail · blocked"]
gate -->|"run: POST /agent<br/>poll /agents/id"| turn["Agent turn<br/>own branch"]
verdict --> exit["Exit code"]
turn --> exit- Runs in CI, usually cold under
npx, so it carries no schema library:readVerdictandreadCardcheck the daemon's answers by hand, and the tests pin them to the contract's schemas. - The default command POSTs what the pipeline knows (arguments, or stdin) to a gate URL copied from the sandbox, which
holds the connection until the gated workflow judges it.
passexits 0,failexits 1, andblockedexits 0 unless--blockedsays otherwise, because a gate that could not judge is not a broken build. intentic-gate runstarts a turn with a control token in its own conversation and branch, polls until it settles, and with--landmerges it. A stopped turn or a refused land isfailed; a land the owner's rules hold stayscompleted, not landed.- Exit 2 is never a verdict. It means the exchange failed (bad token, no such gate, the daily ceiling, the network, a card status this gate does not know), or a run's deadline passed while the agent keeps working in the sandbox.
- The package also exports these functions to gate-action, which wraps them for GitHub: both doors
run the same
gateExchangeandrunExchangeas the CLI, so a failure reads the same in a log and on a step.
Usage
git log -1 | intentic-gate --url "$INTENTIC_GATE_URL"
intentic-gate run --url "$INTENTIC_URL" --token "$INTENTIC_TOKEN" "Review this change"Key files
- src/cli.ts — the process: read stdin, one exchange, print the verdict, exit.
- src/gate.ts — gate door: argument parsing,
gateExchange(the request dial and the verdict read),exitOf. - src/run.ts —
runExchange: start a turn, poll its card, land it, map the ending to an exit code. - src/gate.test.ts — the verdict reader held against
GateVerdictSchema.
Commands
pnpm --filter @intentic/gate test