Skip to content

runtime: policy_path on the status read; a zero-rule baseline; the sync skill generates - #16

Draft
iskhakov wants to merge 12 commits into
mainfrom
appa-status-and-skill
Draft

runtime: policy_path on the status read; a zero-rule baseline; the sync skill generates#16
iskhakov wants to merge 12 commits into
mainfrom
appa-status-and-skill

Conversation

@iskhakov

Copy link
Copy Markdown
Contributor

Cherry-picks the pending branch work onto this history (12 commits, conflicts resolved against what this main had already absorbed, texts translated to the protected vocabulary):

  • policy_path on the status wire: GET /status answers carry the canonical --config path, added in the HTTP layer and never entering TrajectoryStatus; both statuslines prefer it for locating the policy they count, with the APPA_CONFIG_DIR/platform default as fallback — the statistics follow whichever runtime the session is protected by, and the dev launch needs no extra variable.
  • Statusline policy statistics: the second row's tools:/rules: counts, where rules: counts label rules only — an argument pin (parameters) constrains a call and labels nothing.
  • A zero-rule starting policy: the examples name every built-in tool but pre-fill no delta — an unannotated tool's results are admitted as fully unknown until a reviewed rule says otherwise; the web tools' suspicious labels become generated decisions too. The subagent crossing tests pin the neutral annotation themselves (neutralized()), since they test return crossings, not label generation. A fresh deployment shows tools:44 rules:0.
  • /appa-tool-sync becomes inventory → one plan → generation: no question dialogs and no pre-plan quiz — ambiguity is a stated safer-side assumption the user flips in their reply; unreachable servers are skipped with one plan line; gateways unpack; the runtime's reserved remedy tool is never declared. On approval, subagents generate in parallel: policy entries per server, and a dynamic resolver per argument-dependent tool. The interview reads no memory and probes no server healths — the session context already knows.
  • Development docs: one prompt sets up the dev runtime and points clappa at the checkout's plugin for live prompt files.

Verified: cargo test -p appa-runtime-v2 green on this base (14 suites); this main's own plugin_hooks repair is kept where the histories disagreed.

🤖 Generated with Claude Code

iskhakov and others added 12 commits August 18, 2026 14:28
A second row shows tools: (every [[policy.tool]] entry) and rules:
(entries carrying more than the neutral bare-name-plus-delta={}
annotation), and names /appa-tool-sync as the skill that adds rules.
Counting is a line scan mirrored in statusline.ps1, verified against a
tomllib parse of the example policy, and fails open like the rest of
the statusline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The status wire answer gains policy_path, the canonical --config path:
a fact of the process, not the log, so it joins the answer in the HTTP
layer and never enters TrajectoryStatus. Both statuslines prefer that
path for their tool counts and keep the APPA_CONFIG_DIR platform
default as the fallback, so the statistics follow whichever runtime
the session gates through -- the dev launch no longer needs
APPA_CONFIG_DIR. docs/runtime.md's status-read contract carries the
field.

Also repairs plugin_hooks.rs, stale since the APPA_GATE guard: the
drift check now pins SessionStart as the shared command with
ensure-runtime.sh chained before the post, the harness runs gated, and
a new test pins the ungated silent pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The examples name every built-in tool but no longer pre-fill
delta = {}: an unannotated tool's results are admitted as fully
unknown (UNK-5) until a reviewed rule gives the tool a real
annotation, which /appa-tool-sync generates. The neutral annotation
was a claim nobody had reviewed, made 40 times. The four real rules
stay: the Agent/Task run_in_background pins the runtime requires, and
the suspicious web results. The subagent crossing tests pin the
neutral annotation themselves -- they are about return crossings, not
label generation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The web tools lose their pre-filled suspicious deltas too: unknown
already fails closed at every declared sink, and the suspicious rank
is a reviewed decision the sync flow generates. The statusline's
rules: counter stops counting parameters argument pins -- they
constrain a call and label nothing -- so the Agent/Task pins the
runtime requires no longer read as rules. A fresh deployment shows
tools:44 rules:0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The interview collapses to three phases. Inventory walks the toolsets
and MCP servers, skips a server that does not connect with one plan
line instead of probing it, unpacks gateways, and never declares the
runtime's reserved remedy tool. The plan is one plain-text message
with one approval: ambiguity becomes a stated safer-side assumption
the user flips in their reply -- no question dialogs, no pre-plan
quiz. On approval, subagents generate in parallel: one per server
drafting policy entries in the config's own dialect, one per dynamic
resolver for tools whose sensitivity depends on an argument, learning
the resolver contract from the machine. The generation reference the
subagents need (the audience forms and the two loader rules) stays in
the skill, out of the user's sight.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Phases 1 and 2 are mechanical: the lookups batch into two tool calls,
the tool surface comes from the session context, and the skill forbids
reading memory files or project docs -- recalled memory describes past
machine states, every rule the run needs is written in the skill, and
the machine is the source of truth. A minute of silence before the
plan is named a failure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The session context already says which servers answered and which need
auth; claude mcp list health-probes everything and waits out the dead
servers' timeouts, so it runs only when the context leaves a server's
state genuinely unclear.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The shim gains --plugin-dir so gated sessions read every prompt file
live from the checkout; the marketplace plugin is uninstalled
meanwhile, since a plugin loaded twice fires every hook twice.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant