Skip to content

add pi#129

Merged
davidabram merged 13 commits into
mainfrom
pi
Jul 15, 2026
Merged

add pi#129
davidabram merged 13 commits into
mainfrom
pi

Conversation

@davidabram

Copy link
Copy Markdown
Member

No description provided.

@davidabram
davidabram force-pushed the pi branch 6 times, most recently from e55d2a9 to 00d274e Compare July 14, 2026 11:06
davidabram and others added 11 commits July 14, 2026 14:29
Pi consumes project-local prompts (.pi/prompts) and Agent Skills
(.pi/skills) but has no native sub-agent format, so SCE agents are
rendered as agent-role prompt templates (agent-{slug}.md) with an
act-as-role preamble and $ARGUMENTS input.

Adds pi-content.pkl and pi-metadata.pkl mirroring the Claude renderer
pair, wires them into generate.pkl, extends check-generated.sh path
coverage, and enforces Pi metadata keys in metadata-coverage-check.pkl.

Co-authored-by: SCE <sce@crocoder.dev>
Extend prepare-cli-generated-assets.sh and the Nix build asset
staging to copy config/.pi into cli/assets/generated/config/pi,
and add a PI_EMBEDDED_ASSETS target in build.rs (emitted with
allow(dead_code) until setup --pi consumes it). The re-sync also
picks up the previously unsynced integrations block in the
sce-config schema mirror.

Co-authored-by: SCE <sce@crocoder.dev>
Teach the config layer about the pi target so .sce/config.json can
persist and validate it. Adds the Pi variant to IntegrationTargetId
with parse/round-trip support and unit tests, extends the
integrations.target enum in the Pkl schema (JSON schemas regenerated
and the embedded CLI mirror re-synced), and adds a compile-only no-op
doctor match arm until full Pi doctor coverage lands in a later task.

Co-authored-by: SCE <sce@crocoder.dev>
`sce setup` now installs the embedded Pi asset tree into .pi/ via
--pi and expands --all to opencode+claude+pi, replacing the removed
--both flag (now rejected as an unknown option). The interactive
prompt offers OpenCode, Claude, Pi, and All, and installed targets
persist into .sce/config.json integrations.target as before.
EmbeddedAssetSelectionIter is generalized from a two-variant enum to
a slice-chaining iterator so any concrete-target expansion works,
and PI_EMBEDDED_ASSETS drops its dead_code allowance now that it is
consumed.

Co-authored-by: SCE <sce@crocoder.dev>
Add Pi target resolution, prompt/skill integration grouping,
and problem-kind plumbing so `sce doctor` validates installed
`.pi` assets for missing or mismatched embedded content.

Co-authored-by: SCE <sce@crocoder.dev>
Update README, Pkl generation docs, and architecture
context to describe Pi as a first-class generated config
target with setup flags and generated output ownership.

Co-authored-by: SCE <sce@crocoder.dev>
Materialize the .pi/ prompts and skills produced by the Pi asset sync
so the repo carries the same SCE workflows (plan authoring, task
execution, validation, commit, handover) for the Pi harness that
already exist for Claude and opencode. Add "pi" to the integration
targets in .sce/config.json so setup/doctor treat it as active.
Pi previously had no runtime hook into SCE bash-tool policy. Add a
project-local Pi extension (config/lib/pi-plugin/sce-pi-extension.ts,
emitted verbatim by config/pkl/generate.pkl to
config/.pi/extensions/sce/index.ts) whose tool_call handler delegates
bash-command evaluation to `sce policy bash --input normalized --output
json` and blocks denied commands with the policy ID and reason. All
failure paths (missing CLI, timeout, non-zero exit, invalid JSON) fail
open.

Adds the type-only @earendil-works/pi-coding-agent dependency, extends
config/pkl/check-generated.sh drift coverage to config/.pi/extensions,
and includes the plan and context updates for this slice.

Co-authored-by: SCE <sce@crocoder.dev>
Capture completed Pi user and assistant messages
on message_end, extract text and reasoning parts,
and send mixed message/message.part batches to
sce hooks conversation-trace with fail-open
fire-and-forget behavior.

Co-authored-by: SCE <sce@crocoder.dev>
Record unified diffs for Pi edit/write tool calls: a tool_call handler
captures pending mutations (target path, prior contents) keyed by
toolCallId, and the tool_result handler produces a diff via
git diff --no-index on temp files, rewriting header labels to the
repo-relative path. Each diff is emitted fire-and-forget as a synthetic
patch conversation part and a normalized diff-trace payload with
tool_name "pi", nullable model_id/tool_version. Failed edits and no-op
writes produce no rows; missing sce binary fails open.

Co-authored-by: SCE <sce@crocoder.dev>
Pi diff-trace payloads previously stored raw session IDs, making Pi
provenance indistinguishable from unprefixed sources. Add PI_TOOL_NAME
and DIFF_TRACE_PI_SESSION_ID_PREFIX with a "pi" match arm in
prefixed_diff_trace_session_id(), keeping oc_/cc_ behavior and
unknown-tool passthrough unchanged. Tests cover fresh prefixing,
idempotency, normalized payload persistence, and post-commit
intersection provenance.

Co-authored-by: SCE <sce@crocoder.dev>
@davidabram
davidabram force-pushed the pi branch 3 times, most recently from dede184 to 7b068b0 Compare July 15, 2026 14:00
davidabram and others added 2 commits July 15, 2026 16:27
The Pi SCE extension existed only as a project-local source file and was
not shipped through the asset pipeline, so `sce setup --pi` could not
install it and `sce doctor` had no visibility into its health.

Sync `config/.pi/extensions/sce/index.ts` into the generated CLI assets
(embedded wholesale via the existing whole-tree copy), and bucket
embedded `extensions/**` Pi assets into a new `Pi extensions` doctor
integration group so missing or drifted extension files are flagged
through the existing Pi integration problem kinds.

Co-authored-by: SCE <sce@crocoder.dev>
Implement the Pi extension entrypoint
with bash policy enforcement, conversation
trace capture, and edit/write diff trace
forwarding through the SCE CLI hooks.

Co-authored-by: SCE <sce@crocoder.dev>
@davidabram
davidabram merged commit 7a42ec7 into main Jul 15, 2026
6 checks passed
@davidabram
davidabram deleted the pi branch July 15, 2026 14:56
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