Skip to content

feat(compiler): add offline advisory consultation packets - #14

Draft
joehertel wants to merge 1 commit into
WeaveMindAI:mvpfrom
joehertel:feat/offline-codex-consultation
Draft

feat(compiler): add offline advisory consultation packets#14
joehertel wants to merge 1 commit into
WeaveMindAI:mvpfrom
joehertel:feat/offline-codex-consultation

Conversation

@joehertel

Copy link
Copy Markdown

Why

This adds a narrow way to consult an external reviewer during implementation or validation without making model access part of compilation.

The compiler emits a deterministic, digest-bound request packet. A separate process may obtain advice offline, and Weft can validate the returned packet. Advice remains non-executing and non-authoritative.

CONTRIBUTING.md asks larger compiler changes to start with an issue. I am opening this as a draft so the exact implementation is reviewable, not asking for merge yet. If an issue-first discussion is preferred, I am happy to move the design conversation there.

This targets mvp because the implementation was built and tested against mvp@786bf97ae5a842452b69c900b785c8ee35c7d0a5.

What changed

  • add closed request and response schemas with canonical SHA-256 binding
  • bind source and definition digests plus normalized repository-relative locators
  • require immutable read-only, no-canonical-write, and no-side-effect constraints
  • require provider/model provenance and exact request binding on responses
  • reject malformed JSON, unknown fields, weakened constraints, unsafe paths, digest mismatches, and invalid status semantics
  • require findings for advice and blocked; forbid findings for abstain
  • add deterministic disabled, not-configured, unavailable, and timeout outcomes
  • add weft-codex-consult emit and non-executing verify commands
  • document the offline protocol and non-goals

Safety boundary

This PR does not:

  • dispatch a model
  • access the network from Weft
  • launch a process or runtime
  • execute or automatically apply advice
  • write canonical state
  • install or wire a Codex runtime

Validation

  • cargo test -p weft-compiler --test codex_consultation
  • cargo test -p weft-compiler --test codex_consultation_cli
    • 11 passed, 0 failed
  • cargo test -p weft-core -p weft-compiler --locked
    • 711 passed, 0 failed, 3 ignored across 11 result blocks
  • source-fidelity audit: exactly 3 modified tracked paths and 5 new paths
  • patch reverse-check passed; forward application to a fresh pinned export reproduced all 8 changed files byte-for-byte with core.autocrlf=false

Clippy disclosure

cargo clippy -p weft-compiler --lib --bins --tests --locked --no-deps -- -D warnings remains nonzero on existing workspace diagnostics. The captured run reported no diagnostics in the consultation-owned source, binary, or test paths.

Review focus

I would especially value feedback on whether this packet boundary belongs in weft-compiler, and whether blocked requiring at least one explanatory finding is the right closed semantic.

Add an explicit, optional packet protocol for exporting bounded compiler
context to an external reviewer and validating returned advisory findings.

The compiler does not dispatch a model, access the network, execute advice,
or perform canonical writes. Packet and response validation fail closed on
schema, digest, path, constraint, provenance, and status-semantics errors.
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