Example

Compile one plan and refuse the rest

See one plan assembled from source obligations, the request, declared state and any authorised inference, with an over-broad inference refused and a decisive block kept visible.

If the layer is to adapt to a person, it has to be able to say what it did and why. The chapter’s mechanism is a compiler that produces one plan from four inputs — the source’s obligations, the current request, the declared state, and any authorised inference — and a receipt for every input it took or refused.

Run it

git clone https://github.com/ernanhughes/project-language.git
cd project-language
git checkout 329660f679a5a87831f91fe1430c20ac9360dda8
npm ci
npm run example:personal -- ch23

The example is cumulative, so the earlier chapters’ fixture stages are established first. The model is a scripted stand-in.

Expected outcome

One plan, and every input accounted for:

...
plan plan-003: PLAN / personalised / optional conditioning used
  decisive-equation    visible by preservation
  intro-assumptions    visible by preservation
  failure-assumptions  visible by preservation
  supporting-step-1    folded  by instruction
  supporting-step-2    folded  by instruction
  library-release      folded  by inference
  input acc-keyboard: used
  input pol-arch-review: used
  input ov-pre-meeting: used
  input inf-001: used
  input inf-002: refused — SCOPE_EXPANSION_IS_NEW_INFERENCE: evidence supports "architecture-review:protocol-p1"; using it for "architecture-review:talk-q" is a new inference and inherits no support from the old one
  input pref-terse-triage: inapplicable

The decisive material stays visible by preservation, and the block that an authorised inference folded is recorded as folded by inference — the reason travels with the decision.

The same chapter also shows the comparison that makes the result inspectable: a generic plan, compiled with the optional state removed:

...
generic path: no optional observation or inference conditions the view (declared standing state, preservation and accessibility still apply):
plan plan-011: PLAN / personalised
  ...
  library-release      visible by default
  ...
  input inf-001: disabled
  input inf-002: disabled
  input obs-expand-derivations: disabled

And the run is careful about what that comparison proves:

...
difference from the personalised plan:
  none
  inspection aid, not causal proof: a recompiled view can differ for reasons other than the removed state

Decisive material is not folded

Binding preservation outranks an inference, an instruction and an overlay. This is the block-treatment rule:

  const planBlocks: PlanBlock[] = blocks.map(b => {
    if (mustKeep.has(b.id) || b.role === "decisive" || instruction?.keep_visible?.includes(b.id)) return { block_id: b.id, treatment: "visible", decided_by: "preservation", reason: "binding: decisive material stays visible" };
    if (instructionFold.has(b.role)) return { block_id: b.id, treatment: "folded", decided_by: "instruction", reason: `the current request asked to fold ${b.role} material; it remains available` };
    if (overlayFold.has(b.role)) return { block_id: b.id, treatment: "folded", decided_by: "overlay", reason: `this session's overlay folds ${b.role} material; it remains available` };
    if (inferenceFold.has(b.id)) return { block_id: b.id, treatment: "folded", decided_by: "inference", reason: "an authorised inference supported folding it" };
    return { block_id: b.id, treatment: "visible", decided_by: "default", reason: "nothing asked to fold it" };
  });

And an inference has to clear every gate before it is used — scope, authority, the communication bar, and preservation:

    const why: string[] = []; const receipts: string[] = [];
    const scope = checkScope(b, b.applied_scope); if (!scope.ok) why.push(`${scope.code}: ${scope.why}`);
    const auth = authorizeUse(b, "REUSE", input.authority.purpose, input.authority.policy, input.now); receipts.push(auth.receipt.receipt_id); if (!auth.allowed) why.push(`not authorised: ${auth.why}`);
    const bar = mayChangeCommunication(b, !!p.confirmed_by_person); if (!bar.ok) why.push(bar.why);
    const hidden = p.fold.filter(f => mustKeep.has(f) || byId.get(f)?.role === "decisive"); if (hidden.length) why.push(`it would fold decisive material (${hidden.join(", ")}); binding preservation outranks an inference`);
    if (why.length) { setInput(b, "refused", why, receipts); explanation.push(`inference not used: ${b.proposition} (${why[0]})`); }
    else { setInput(b, "used", [`authorised, within scope, bar met: ${b.proposition}`], receipts); usedBeliefs.push(b.id); for (const f of p.fold) inferenceFold.add(f); }

Mechanism and limitations

Documented: the input statuses, the block treatments and the two conflict codes — BINDING_OBLIGATIONS_CONFLICT and PRESERVATION_EXCEEDS_BUDGET — are in core/personal/src/compiler.ts.

Observed: the run above. inf-001 was used and folded one block; inf-002 was refused with the scope-expansion reason; the inapplicable preference was reported as inapplicable; and the decisive blocks stayed visible by preservation in both the personalised and the generic plan.

Not shown. The plan is a record of what the gates admitted and why the others were not. It does not prove that the view communicates better, that the person benefits, or that the inputs are true. The compiler’s token budget, the time-per-token constant and the consequence table are declared policy, not measured. The comparison between the personalised and generic plans is an inspection aid, not causal proof.

Canonical source and the personal compiler .

Understand this example

Copy this prompt into your AI tool. No code runs here.

Apply this example

Copy this prompt into your AI tool. No code runs here.