Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 197 additions & 22 deletions docs/expression-contract.md

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions docs/maintainer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,19 @@ a later row explicitly supersedes an earlier answer-shape rule, the later row
is current authority and the earlier row remains historical context only. In
particular, #827 supersedes #543's effort/closed-chart ceiling and #674's fixed
refusal shape while preserving their latency, numeric-grounding, and state
integrity findings, and #830 supersedes the whitelist-era answer obligations
integrity findings, #830 supersedes the whitelist-era answer obligations
(#479 Wave B cut 2, #823, #825) while preserving every integrity gate they
built.
built, and #832 supersedes the **answer-shape phrasing** in all five surfaces
that carried one (#823's per-surface layout classification, the card keynote,
V1, SKILL.md's reader-order paragraph, `decision-framing.md`'s bounded-value
lead, `weekly-market-read.md`'s value-first, plus `trade-consequence.md`'s
reader-question-chain) while leaving those rows' every other ruling intact.

| Fact | Surfaces that must stay synchronized |
|---|---|
| Output structure & language | `docs/output-contract.md` (single authority on section order) and `docs/output-language.md` (locale contract) ↔ `card_renderer.py` ↔ `references/card-policy.md` / `card-spec.md` (subordinated: wording and in-block ranking only) |
| How the product speaks, on every surface (#823, #825) | `docs/expression-contract.md` is the single authority for expression — voice routes to `docs/output-voice.md`, disclosure relevance is D1–D6, and citation/provenance is C1–C4. Its surfaces are `docs/output-contract.md` §4 ↔ `references/trade-consequence.md` ↔ `references/freeform-answers.md` ↔ `references/decision-framing.md` ↔ `references/weekly-market-read.md`. The card may keep its footnote as local layout, but conversational surfaces have no mandatory tail block, prefix, or line cap. `tests/agent/check_expression.py` now enforces only E-5/C4 (no engine-token leaks); #825 retired E-1–E-4 because block position, marker syntax, line count, and literal deduplication did not prove relevance or clarity. `tests/test_expression_contract.py` keeps registry/routing checks and pins that D1–D6 honestly declare instruction-only verification. |
| One communication method: the answer pyramid (#832, 2026-08-21) | `docs/expression-contract.md` §3 is the **mother law** of answer shape and the only statement of it. Its readers, each of which now carries a *derivation* rather than a phrasing: `docs/output-contract.md` §2 (the card is the document incarnation — keynote = top floor, three middle blocks = the middle, the Block-1 footnote = the end block; the card's own structure is unchanged) ↔ `docs/output-voice.md` (V1 keeps its ID as the **failure class** and stops being a second statement of the rule) ↔ `skills/fomo-kernel/SKILL.md` "Shape of the answer" (the always-on projection, explicitly labelled as one) ↔ `references/trade-consequence.md` (adds exactly two parameters: lead selection and answer slots) ↔ `references/decision-framing.md` (adds two: the baseline is the top sentence with no book, the strategy-class map is a middle-floor block set) ↔ `references/weekly-market-read.md` (adds one: its optional question comes after the complete brief) ↔ `references/freeform-answers.md` (**adds nothing — an empty derivation is valid and is the default**) ↔ `tests/agent/expression-witnesses.json` ↔ `tests/agent/check_expression.py` (E-7/E-8) ↔ `tests/test_expression_contract.py` ↔ `tests/test_research_priors.py` (which pinned the no-book phrasing by literal and now pins the block order and the derivation instead). Four rules. **Derivation is additive-only**: a surface may add which blocks its middle may hold, which questions it may ask, what its end block must name, or what it may not compute — it may not restate, narrow, re-order, or contradict the shape. **The registries are frozen for shape and length**: V, D, and C take **no new ID** for "answers are too long", "lead with X", or "stop repeating Y", because five independently-worded statements of answer-first is the disease and a sixth with an ID on it is still a sixth; V10 stays unallocated (proposed in #830, demoted there, refused here). **A style fix has two lanes and only two**: amend §3 (owner ruling required, logged in §8) or add an exemplar/counter-exemplar to the witness corpus (day-to-day, no ruling). **The exemplars are the spec, and the oracle is honest about its half**: E-7 decides that a scene's declared one-sentence answer really leads, E-8 that every declared block really adds a distinct increment; the manufactured-scenario and hedging-couplet bans have **no** mechanical oracle, and the corpus asserts that by requiring their counter-exemplars to *pass* every assertion — the day one of them can be caught, that assertion is what says the boundary moved. Why the row exists at all: #830's post-merge rerun (PR #831) fixed composition and moved first-answer length by less than 5%, which is the evidence that deleting obligations without a positive shape norm only vacates space for discretionary elaboration. **Not adopted, again**: any character-count cap — #543's ceiling stayed deleted, and length is the shape's consequence, never its rule. Integrity gates (engine-owned numbers, provenance, canonical writes, execution truth, privacy) and #829 are untouched and out of scope. |
| Runtime behavior | engine ↔ `SKILL.md` and routed flows/references ↔ `docs/eval-design.md` ↔ `evals/EVALS.md` |
| Demo card values | English README ↔ English demo HTML/image; Traditional Chinese README ↔ Traditional Chinese demo HTML/image. Values must match; only wording differs. |
| GTM documentation | `README.md` is the English default; `README.zh-TW.md` is the complete Traditional Chinese counterpart. Keep language links and substantive product claims synchronized. |
Expand Down
11 changes: 11 additions & 0 deletions docs/output-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@

## 2. Canonical structure: keynote + four blocks

**This structure is the document incarnation of the answer pyramid**
([expression-contract.md](expression-contract.md) §3, owner ruling
2026-08-21 — #832). The keynote is the pyramid's top floor rendered as a
document, the three middle blocks are its increment-gated middle, and Block 1's
footnote is its end block. Nothing about the card changes: the derivation is
recorded so the card stops being read as an independent statement of
answer-first, which is what five surfaces each saying it their own way had
already cost. The keynote's own rules below — one sentence, the period's most
important judgment, the review window on its own line — are this surface's
**added parameters**, not a second answer-shape rule.

Every committed review card renders, in this order:

| # | Block | Content | Demo-card anchor |
Expand Down
27 changes: 22 additions & 5 deletions docs/output-voice.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,18 @@ Voice is one of three expression registries.
[expression-contract.md](expression-contract.md) routes to this file for V1–V9
and owns the other two: **where a disclosure goes, and on which floor** (D1–D7) and **how a claim
states where it came from** (C1–C4). A rule about placement or citation belongs
there, not here; a rule about what an answer leads with, refuses to
manufacture, or stops at belongs here.
there, not here; a rule about what an answer refuses to manufacture or stops at
belongs here.

**The shape of an answer is not this file's** (#832, 2026-08-21). The
[expression contract](expression-contract.md)'s §3 mother chapter is the one
statement of it — one-sentence answer on top, an increment-gated middle, the
rest of the inventory behind a single offer, one caliber block at the end — and
V1 derives from it rather than stating it a second time. **This registry takes
no new ID for a shape or a length concern**: a style fix is either an owner
amendment to §3 or a new exemplar in
`tests/agent/expression-witnesses.json`. V10, proposed as a reading budget in
#830 and demoted there, stays unallocated for the same reason.

Phase 1 integrates and proves this authority only on `consider` and no-book
decision framing. That limited proof does not exempt other surfaces; it avoids
Expand All @@ -44,9 +54,16 @@ deterministic product truth.

## Rules

- **V1 — decision value before boundary.** Lead with the supported decision
tension or completion, not an error, process description, disclaimer, or
generic limitation.
- **V1 — decision value before boundary.** What an answer leads with is the
pyramid's top floor and
[expression-contract.md](expression-contract.md) §3 owns it. V1 keeps its ID
as the **failure class**: an answer that opens on an error, a process
description, a disclaimer, or a generic limitation instead of the supported
decision is classified V1 by the witness oracle and by every cross-host run
recorded under that ID. Its historical definition — "lead with the supported
decision tension or completion" — is superseded by §3 as a *statement of the
rule*, and preserved here because the fixtures and rulings that cite V1 are
about this failure.
- **V2 — nearest useful completion.** If a requested action or calculation is
unavailable or out of scope, complete the closest allowed reasoning task
rather than stopping at the boundary.
Expand Down
18 changes: 9 additions & 9 deletions skills/fomo-kernel/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Use relevant evidence and the recorded book when portfolio consequences matter;

## Answer a live decision

Use `consider` when the user supplies a trade premise and asks what it does to a recorded book. It is the deterministic portfolio-consequence path, not a prerequisite for company research, candidate discovery, or a non-portfolio recommendation.
Use `consider` when the user supplies a trade premise and asks what it does to a recorded book. It is the deterministic portfolio-consequence path, never a prerequisite for research, discovery, or a non-portfolio recommendation.

```bash
cd skills/fomo-kernel
Expand All @@ -20,7 +20,7 @@ A premise needs a `ticker`, a `side`, and one of `qty` or `notional`. Everything

Pass `--language` as the tag the user is writing in; an unsupported tag falls back to `en`. Keep conversing in their language and never hand-translate engine copy.

First run only: `pip install -r requirements.txt`, then `python3 engine/review.py doctor`. The engine fail-soft degrades without its optional dependencies — silently dropping current prices, P&L, alpha/beta, and market context — so verify once rather than discovering it inside an answer.
First run only: `pip install -r requirements.txt`, then `python3 engine/review.py doctor`. The engine fail-soft degrades without its optional dependencies — silently dropping current prices and market context — so verify once rather than mid-answer.

## The response is the contract

Expand All @@ -36,15 +36,15 @@ Read portfolio consequence from that payload; never recompute or fill its gaps.

## Research only what could change the recommendation

The engine computes portfolio consequence; it is not a company-research service. Do not fetch a standing market packet on every call. Look up current price, recent movement, valuation, an event, or operating evidence only when that fact is material to the user's question or could change the recommendation. A found event never becomes the user's motive until they confirm it is. `references/market-lookup.md` owns the bounded lookup and provenance contract.
The engine computes portfolio consequence; it is not a company-research service. Look up current price, recent movement, valuation, an event, or operating evidence only when that fact is material to the user's question or could change the recommendation. A found event never becomes the user's motive until they confirm it is. `references/market-lookup.md` owns the bounded lookup and provenance contract.

## Shape of the answer

Answer in the reader's own order — what they asked, the answer, why, what would overturn it, what to do — not the payload's field order. Say what this decision needs, not what exists. Open on the stance and the reason that decides it: proceed, resize, delay, collect evidence, choose one candidate, or no trade. Carry the one or two numbers that would flip it, and every `rule_effects` entry, which is never optional. Give a directional call a falsifier — that is the counter-case, and it needs no section. Ask only decision-changing questions, then stop.
One shape, every answer (`../../docs/expression-contract.md` §3 owns it; this is its projection, not a second wording). **A fact lives on exactly one floor, and twice is a bug.** *Top:* one sentence — the stance and the reason that decides it (proceed, resize, delay, collect evidence, choose one candidate, no trade). *Middle:* only blocks that add a new decision-relevant fact or judgment — delete one; if the decision does not change, delete it. There live the numbers that would flip the call, every `rule_effects` entry (never optional), a truth-critical denominator, unit, or pricing set beside its number, and a falsifier on any directional call — the counter-case needs no section. *Bottom:* the rest of the inventory stays in the data layer; say once you can expand it. *End:* one compact block for other material limitations; machine anchors and engine narration nowhere.

**A fact lives on exactly one floor; twice is a bug** — deciding facts in the body, a truth-critical denominator, unit, or pricing set beside its number, other material limitations in one compact end block, machine anchors and engine narration nowhere. `references/trade-consequence.md` holds the rest.
Never manufacture a scenario nobody asked for, restate a system default as insight, hedge in couplets, or make one point twice. Ask only decision-changing questions, then stop. `references/trade-consequence.md` holds the rest.

Label your thesis, valuation, timing, forecast, recommendation, ranking, or selection as judgment, separate from engine facts. Give a target or forecast's material assumptions and uncertainty; never disguise it as fact or certainty. Never claim what the user did or will do.
Label judgment — thesis, valuation, timing, forecast, recommendation, ranking, selection separate from engine facts. Give a target or forecast's material assumptions and uncertainty; never disguise it as fact or certainty. Never claim what the user did or will do.

**Candidate discovery and comparison.** For an explicit search, report universe,
filters, as-of point, material exclusions, and coverage limits; never imply
Expand All @@ -59,7 +59,7 @@ evaluation row.
- **Unpriced instruments.** The payload says how to return them. Read closes from the publisher's page, transcribe the `references/price-feed.md` envelope, and rerun with `--prices <path>`. If none are published, `--prices-unavailable '<sources checked>'` refuses only the current-value portfolio consequence; still give supported non-portfolio judgment. Never invent, interpolate, or recall a price; missing is not delisted or zero.
- **No recorded book.** `consider` fails closed for book-derived claims. Continue with supported research and judgment, and frame the decision under `references/decision-framing.md`; do not manufacture portfolio precision or persist the conversation.

A refusal does not end the turn. You still owe the judgment that holds without the numbers the engine would not compute — say plainly what could not be checked and name what would unblock it, because the user's next move is to close that gap. Never present a degraded number as if it were the real one: a forward-looking decision is refused rather than answered on cost weights precisely because cost weights can invert which position is the largest.
A refusal does not end the turn. You still owe the judgment that holds without the numbers the engine would not compute — say plainly what could not be checked and name what would unblock it. Never present a degraded number as if it were the real one: a forward-looking decision is refused rather than answered on cost weights, which can invert which position is the largest.

## After the answer

Expand All @@ -73,7 +73,7 @@ python3 engine/review.py consider --resolve <evaluation_id> --decision acted|dec

## Other jobs

Reach for these when the user asks for them. None of them routes an ordinary decision.
Reach for these when the user asks. None routes an ordinary decision.

| The user wants | Do this |
|---|---|
Expand All @@ -84,4 +84,4 @@ Reach for these when the user asks for them. None of them routes an ordinary dec
| To continue after an interruption | `python3 engine/review.py resume` — never refetch prices mid-session |
| A failed projection repaired | `python3 engine/review.py repair-projections` |

A simple ad hoc question defaults to a fast, direct text answer. Use relevant research, multiple tools, or a visual when the user asks or when it materially improves the decision; keep the work proportionate and report material coverage limits.
A simple ad hoc question defaults to a fast, direct text answer; scale research, tools, and visuals to decision value and report material coverage limits (`references/freeform-answers.md`).
4 changes: 2 additions & 2 deletions skills/fomo-kernel/engine/evaluation_challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@
#
# `concentration` and `cash` left this tuple in #830 and now live in
# `MAY_STATE_TOPICS`. The order that remains is a dependency order, never a
# reading order: `references/trade-consequence.md` states the reader's own
# question chain the answer is arranged by, and the deciding fact opens it.
# reading order: `docs/expression-contract.md` §3 owns the shape the answer is
# arranged in, and the deciding fact opens it.
TOPICS = ("basis", "price_basis", "position",
"rule_collision", "disclosure", "excluded_holding", "out_of_scope")

Expand Down
24 changes: 17 additions & 7 deletions skills/fomo-kernel/references/decision-framing.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,19 @@ when it could change the recommendation or unlock the portfolio claim.
## Voice and expression authority

Apply the global [expression contract](../../../docs/expression-contract.md):
voice through the [output-voice contract](../../../docs/output-voice.md)
(V1–V9), disclosure relevance and placement through D1–D7, provenance labelling through
C1–C4. They own universal output semantics; this reference owns the no-book
facts, questions, and route order below.
the answer's shape through its §3 mother chapter, voice through the
[output-voice contract](../../../docs/output-voice.md) (V1–V9), disclosure
relevance and placement through D1–D7, provenance labelling through C1–C4.
They own universal output semantics; this reference owns the no-book facts,
questions, and route order below.

**This route's derivation from §3, and nothing more** (#832): with no book,
the pyramid's top sentence is a *research-backed baseline* rather than a
computed consequence, and the strategy-class map below is a middle-floor block
set. Both are stated once, in "Research-aware strategy framing". Everything
else about the shape — that the top is one sentence, that every block must add
a new decision-relevant fact, that the rest of the inventory waits behind one
offer — is §3's, and this file no longer says it a second time.

## What the answer is

Expand All @@ -45,11 +54,12 @@ A useful framing may carry:

When a user asks for a strategy before they have a book, do not make them
invent an exit philosophy before supplying the bounded value available now.
For a simple strategy question, lead with the bounded value already supported:
This route's block order — the parameter it adds to the pyramid, whose top
floor is already the answer:

```text
research-backed baseline
→ applicable strategy-class map
research-backed baseline (the top sentence, when no book exists)
→ applicable strategy-class map (middle floor)
→ any question whose answer could change the recommendation
```

Expand Down
Loading
Loading