Skip to content

feat(compiler): current-belief view (Bernard profile) - #51

Merged
tymofiy merged 4 commits into
mainfrom
projection-20260704
Jul 5, 2026
Merged

feat(compiler): current-belief view (Bernard profile)#51
tymofiy merged 4 commits into
mainfrom
projection-20260704

Conversation

@tymofiy

@tymofiy tymofiy commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Current-belief view (Bernard profile)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-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 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 live in the module docstring; behavioral pins in CurrentBeliefTests (11 cases).
  • docs: CONVENTIONS.md product-name example refresh.
  • The two 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

  • Extended 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).

tymofiy and others added 4 commits June 30, 2026 12:04
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>
Copilot AI review requested due to automatic review settings July 5, 2026 11:47
@tymofiy
tymofiy merged commit a708801 into main Jul 5, 2026
5 checks passed
@tymofiy
tymofiy deleted the projection-20260704 branch July 5, 2026 11:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.py and wires it into compile_bundle to emit logical/current-belief.jsonl and logical/belief-contentions.jsonl, plus summary counts/hashes.
  • Extends graph compilation parsing to preserve belief.* compiler annotations as sidecar per-claim profile inputs (without changing claims.jsonl rows).
  • Adds an 11-case behavioral test suite (CurrentBeliefTests) and updates compiler documentation; refreshes a product-name example in spec/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.

Comment on lines +26 to +29
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
Comment on lines +88 to +91
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.
Comment on lines +133 to +137
@dataclasses.dataclass(frozen=True)
class BeliefContentionRow:
relation_uid: str
kind: str # "tension_lean" | "unresolved_contradiction"
relation_type: str

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread compiler/README.md
Comment on lines +43 to +44
answer; the current-belief view derives it — a profile extension contributed
by Bernard, the first commercial implementer (GOVERNANCE.md). The pack record

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

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.

2 participants