feat(compiler): current-belief view (Bernard profile) - #51
Conversation
Local-only audit commit for the ignored client-name guard configuration. No tracked public files changed. Co-Authored-By: Codex <noreply@openai.com>
Preserves the local hook audit commit without changing tracked public files.
Co-Authored-By: Codex <noreply@openai.com>
Derive a deterministic action view over supersession: per superseded claim, the frontier of current successors and one pointer chosen by a documented ladder (authority annotation, since, evidence count, claim uid ascending) with contest-scoped rung applicability; refinement splits (pairwise-distinct belief.scope) keep a null pointer; live contradicts:tension edges get a lean; error contradictions surface without one; cross-pack edges never affect currency. Emitted as two new logical artifacts plus summary counts and hashes - every previously shipped surface stays byte-identical. Profile inputs ride the existing kp-compiler annotation channel (belief.authority, belief.scope), carried beside claims so claims.jsonl does not change. The record stays authoritative (RATIONALE.md P4): the view is derived, rebuildable, and profile-scoped. Normative semantics in the module docstring; behavioral pins in CurrentBeliefTests (11 cases: fan-in tie-breaks, chain pass-through, split, dormant/live tensions, tier-withheld successors, cross-pack sovereignty). Suite 50/50. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new derived “current-belief” logical view (Bernard profile) to the compiler output, producing deterministic per-claim successor pointers over supersession fan-in and lean signals for live in-pack tensions, without changing existing shipped artifacts.
Changes:
- Introduces
compiler/current_belief.pyand wires it intocompile_bundleto emitlogical/current-belief.jsonlandlogical/belief-contentions.jsonl, plus summary counts/hashes. - Extends graph compilation parsing to preserve
belief.*compiler annotations as sidecar per-claim profile inputs (without changingclaims.jsonlrows). - Adds an 11-case behavioral test suite (
CurrentBeliefTests) and updates compiler documentation; refreshes a product-name example inspec/CONVENTIONS.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/CONVENTIONS.md | Updates product-name capitalization examples. |
| compiler/tests/test_graph_compiler.py | Adds CurrentBeliefTests to pin current-belief semantics and edge cases. |
| compiler/README.md | Documents the new current-belief view outputs and annotation inputs. |
| compiler/graph_compiler.py | Captures belief.* profile annotations, emits new logical artifacts, and reports summary stats/hashes. |
| compiler/current_belief.py | Implements deterministic current-belief + contention-row derivation over projected bundle packs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| try: | ||
| from .current_belief import current_belief_rows | ||
| except ImportError: # direct script invocation (python compiler/graph_compiler.py) | ||
| from current_belief import current_belief_rows |
| from current_belief import current_belief_rows | ||
|
|
||
|
|
||
| SCHEMA_VERSION = 6 |
| Profile annotations ride the existing ``<!-- kp-compiler: … -->`` channel: | ||
| ``belief.authority=<explicit_user|observed|inference|third_party>`` and | ||
| ``belief.scope=<free-string>``. Unannotated packs get the identical view | ||
| with the profile rungs silent. |
| @dataclasses.dataclass(frozen=True) | ||
| class BeliefContentionRow: | ||
| relation_uid: str | ||
| kind: str # "tension_lean" | "unresolved_contradiction" | ||
| relation_type: str |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0915e1413
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Current-belief view (Bernard profile; see compiler/current_belief.py). | ||
| # Computed over the PROJECTED packs so the view is consistent with the | ||
| # bundle it ships in; a derived surface — no shipped artifact above moves. | ||
| belief_rows, contention_rows = current_belief_rows(parsed_packs) |
There was a problem hiding this comment.
Avoid choosing pointers from a filtered successor subset
When a lower-tier bundle retains one superseder but filters another, this computes the ladder over only the projected claims and can emit a concrete pointer even though the source-level contest is incomplete. For example, if public C002 and server-only C003 both supersede public C001, the client bundle will point C001 at C002 instead of marking the result unresolved, and C003 may have been the actual winner by recency/authority; pass enough source supersession information through projection or mark partial frontiers as unresolved_in_bundle rather than selecting from the retained subset.
Useful? React with 👍 / 👎.
| answer; the current-belief view derives it — a profile extension contributed | ||
| by Bernard, the first commercial implementer (GOVERNANCE.md). The pack record |
There was a problem hiding this comment.
Replace the implementer name with a generic profile label
This new public compiler prose names Bernard as the commercial implementer for the profile. The repo-level AGENTS.md rule 9 says public examples/prose must not use real client, vendor, or private-engagement names and should use fictional generic placeholders; keeping the name here, also repeated in current_belief.py, leaks operational context in a public artifact.
Useful? React with 👍 / 👎.
Summary
compiler/current_belief.py: a deterministic action view derived over supersession. Per superseded claim: the frontier of current successors and one pointer chosen by a documented ladder (authority annotation → since → evidence count → claim uid ascending), with contest-scoped rung applicability. Refinement splits (pairwise-distinctbelief.scope) keep a null pointer; livecontradicts:tensionedges get a lean; error contradictions surface without one; cross-pack edges never affect currency. Emitted as two new logical artifacts plus summary counts and hashes — every previously shipped surface stays byte-identical.belief.authority,belief.scope), carried beside claims, soclaims.jsonldoes not change.CurrentBeliefTests(11 cases).chore(hooks)commits are intentional no-ops (no tracked files changed); they record local, git-ignored guard configuration per the repo's private deny-list mechanism (.private-deny-list.example).Test plan
compiler/tests/test_graph_compiler.py: fan-in tie-breaks, chain pass-through, refinement splits, dormant/live tensions, tier-withheld successors, cross-pack sovereignty. Full suite green (50/50).