Skip to content

Node Only Agent Loop

kadubon edited this page Jul 1, 2026 · 3 revisions

Node Only Agent Loop

This page shows a local loop that works from npm without Python.

The goal is practical: preserve useful candidate work, keep missing work visible, and produce JSON reports that another agent or CI job can inspect.

Create Demo Files

npx pic-ts demo bootstrap --output-dir .pic-demo --overwrite

This creates small JSON files for a runtime state, runtime input, phase request, and threshold example.

Run A Runtime Step

npx pic-ts runtime step \
  --state .pic-demo/runtime_state.json \
  --input .pic-demo/runtime_step_input.json \
  --output .pic-demo/runtime_step_report.generated.json

The result is a JSON report. It can be useful even when settled=false.

Export And Inspect A Packet

npx pic-ts packet export \
  --report .pic-demo/runtime_step_report.generated.json \
  --output .pic-demo/packet.json

npx pic-ts packet inspect --packet .pic-demo/packet.json

Packet content is inert data. The inspector may detect command-like text such as npm, node, docker, kubectl, curl, bash, or powershell, but it does not run it.

Build A Phase Plan

npx pic-ts phase plan --request .pic-demo/asi_proxy_phase_request.json --compact
npx pic-ts phase gap --request .pic-demo/asi_proxy_phase_request.json --compact

Candidate-only intake does not reduce the phase gap. Missing obligations and blockers remain visible.

Emit CCR Handoff Records

npx pic-ts phase plan --request .pic-demo/asi_proxy_phase_request.json --compact --emit ccr-tasks --output tasks.jsonl
npx pic-ts phase gap --request .pic-demo/asi_proxy_phase_request.json --compact --emit ccr-residuals --output residuals.jsonl

These files can be imported by a scheduler such as CCR as candidate work. They do not grant provider, shell, repository, or network authority.

Add Phase Ecology Lab

npx pic-ts phase lab init --output-dir .pic-lab
npx pic-ts phase lab ingest --store .pic-lab --report .pic-demo/runtime_step_report.generated.json
npx pic-ts phase lab observe --store .pic-lab
npx pic-ts phase lab graph --store .pic-lab
npx pic-ts phase lab closure --store .pic-lab
npx pic-ts phase lab executable-paths --store .pic-lab
npx pic-ts phase lab threshold-status --store .pic-lab --threshold .pic-demo/asi_proxy_development.json

The lab stores JSON/JSONL records. It records file basenames, not absolute local paths.

Run The Compact Agent Acceleration Report

npx pic-ts agent accelerate --compact --text "Candidate packet: preserve residuals." --profile development

This is a report generator. It does not execute shell commands or mutate a repository.

What This Loop Means

The loop is useful for Node.js agent runtimes because it produces structured reports that can be reused safely.

It does not prove real ASI, physical outcomes, simulator truth, policy truth, or oracle truth. It preserves unfinished work and shows the next finite checks. When operation_ready=true appears in a TRC report, it still describes a candidate record, not an executed action.

Clone this wiki locally