Git notes#139
Open
davidabram wants to merge 21 commits into
Open
Conversation
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>
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>
Add policies.agent_trace.git_notes_ref parsing, validation, default resolution, and generated schema support for the Agent Trace post-commit git-notes ref. Co-authored-by: SCE <sce@crocoder.dev>
Add a testable git notes helper that validates the ref, commit ID, and Agent Trace JSON before piping content to git notes add -f -F -. Cover configured refs, blank input rejection, command construction, and command failure context. Plan: agent-trace-git-notes Tasks: T02, T03 Co-authored-by: SCE <sce@crocoder.dev>
Write validated post-commit Agent Trace JSON to the configured git-notes ref after DB insertion succeeds, skip explicit non-git VCS contexts, and log note-write failures without failing the hook. Co-authored-by: SCE <sce@crocoder.dev>
Record the completed Agent Trace git-notes context update and final validation, including current post-commit behavior for config precedence and setup-installed hooks. Plan: agent-trace-git-notes Tasks: T05, T06 Co-authored-by: SCE <sce@crocoder.dev>
Expose policies.agent_trace.push_notes.enabled with default true across schema generation, config parsing, runtime resolution, and config show output. Update current-state context for the new config surface.\n\nPlan: agent-trace-git-notes-auto-push\nTask: T01 Co-authored-by: SCE <sce@crocoder.dev>
Adds an injectable helper for pushing the configured Agent Trace notes ref with validation, structured outcome data, and focused tests around command construction and failure context. Plan: agent-trace-git-notes-auto-push Task: T02 Co-authored-by: SCE <sce@crocoder.dev>
Wire post-commit Agent Trace persistence to attempt a silent best-effort push of the configured notes ref after local git-note writes succeed, while honoring the push-notes opt-out and preserving fail-open behavior on push errors. Plan: agent-trace-git-notes-auto-push Task: T03 Co-authored-by: SCE <sce@crocoder.dev>
Cites plan agent-trace-git-notes-auto-push; updates T04 and T05. Co-authored-by: SCE <sce@crocoder.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.