Skip to content

Add planning-service contracts for program induction, counterexample search, and backtracking#38

Merged
mdheller merged 11 commits intomainfrom
witbrock/tritrpc-planning-service
Apr 15, 2026
Merged

Add planning-service contracts for program induction, counterexample search, and backtracking#38
mdheller merged 11 commits intomainfrom
witbrock/tritrpc-planning-service

Conversation

@mdheller
Copy link
Copy Markdown
Member

This PR adds a planning-service layer above the existing execution bridge.

Why:

  • abstract reasoning needs typed planning operations, not hidden prompt behavior
  • program induction, counterexample search, and backtracking must be visible and auditable
  • the stable execution bridge remains narrow and unchanged

What this PR adds:

  • PlanningService contract v0.1
  • planning fixture lane with deterministic example payloads
  • core request/response examples for program induction and counterexample search

What this PR does not do:

  • it does not widen ExecutionBridgeService
  • it does not redefine the stable transport profile

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an initial PlanningService v0.1 contract and a set of deterministic planning fixtures intended to sit above the existing execution bridge, making planning operations auditable and reference-driven.

Changes:

  • Introduces PlanningService contract v0.1 documentation.
  • Adds planning fixture lane with request/response JSON examples for program induction and counterexample search.
  • Adds a fixtures README describing intended fixture coverage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docs/contracts/planning-service-v0.1.md Defines PlanningService goals, methods, and constraints for governed planning.
fixtures/planning/README.md Describes the purpose and planned coverage of planning fixtures.
fixtures/planning/induce-program-candidate.request.json Example request payload for InduceProgramCandidate.
fixtures/planning/induce-program-candidate.response.json Example response payload for InduceProgramCandidate.
fixtures/planning/search-counterexample.request.json Example request payload for SearchCounterexample.
fixtures/planning/search-counterexample.response.json Example response payload for SearchCounterexample.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- `BacktrackPlanNode` request/response
- `ValidateAbstractRule` request/response

These fixtures preserve stable refs to scope, state, objective, and plan-node artifacts.
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This states the fixtures “preserve stable refs to scope, state, objective, and plan-node artifacts”, but the current fixtures in this directory only include scopeRef, planNodeRef/targetRef, etc. Consider either adding the referenced stateRef/objectiveVectorRef fields to the fixtures or adjusting this sentence to match what’s currently present.

Suggested change
These fixtures preserve stable refs to scope, state, objective, and plan-node artifacts.
These fixtures preserve stable refs to scope, plan-node, and target artifacts.

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +25
Planning methods MUST operate on stable references to:
- planning scope ids
- belief-state refs
- objective-vector refs
- policy refs
- plan-node refs
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the “Input discipline” section you say planning methods must operate on “stable references”, but the first bullet is “planning scope ids” (and others are “refs”). This mixes identifier terms and could confuse implementers about whether values are expected to be ...Id or ...Ref strings. Consider making all bullets consistently *Ref (or consistently *Id) and aligning the wording accordingly.

Copilot uses AI. Check for mistakes.

## Rule

Planning methods SHOULD preserve stable references back to `scopeId`, `stateRef`, `planNodeId`, and `objectiveId`.
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “Rule” line mixes scopeId / planNodeId / objectiveId with stateRef, while the rest of the contract emphasizes stable *Ref values. Please standardize the terminology (either all *Ref or all *Id) so the contract is unambiguous about what is passed over the wire.

Suggested change
Planning methods SHOULD preserve stable references back to `scopeId`, `stateRef`, `planNodeId`, and `objectiveId`.
Planning methods SHOULD preserve stable references back to `scopeRef`, `stateRef`, `planNodeRef`, and `objectiveVectorRef`.

Copilot uses AI. Check for mistakes.

The service SHOULD attach one or more of:
- `programCandidateRef`
- `counterexampleRef`
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The contract suggests attaching a counterexampleRef, but the fixture response uses counterexampleRefs (plural array). Please align the contract field naming with the intended wire shape (single ref vs list) to avoid incompatible implementations.

Suggested change
- `counterexampleRef`
- `counterexampleRefs`

Copilot uses AI. Check for mistakes.
@mdheller
Copy link
Copy Markdown
Member Author

@copilot Fix failed checks

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

@copilot Fix failed checks

Implemented fixes for the failed checks in commit 0383072. make verify now passes end-to-end (Rust tests, Go tests, and fixture verification). No UI changes were involved.

Copilot AI and others added 2 commits April 15, 2026 21:26
@mdheller
Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request any any failed tests

Copilot AI and others added 2 commits April 15, 2026 21:35
…conflicts

Co-authored-by: mdheller <21163552+mdheller@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

@copilot resolve the merge conflicts in this pull request any any failed tests

Done. I merged origin/main, resolved the conflicts, and fixed the resulting test break by exporting the merged Rust v4 module (pub mod v4;). Addressed in commit 694d606 (merge commit 7156514 is also included). make verify now passes end-to-end on this branch. No UI changes were involved.

@mdheller mdheller merged commit 8234627 into main Apr 15, 2026
8 checks passed
@mdheller mdheller deleted the witbrock/tritrpc-planning-service branch April 15, 2026 21:38
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.

3 participants