4 Commits
Author SHA1 Message Date
emili 12fb3c78b2 formalizing Named Entity Recognition types, Mask -> NER 2026-10-28 12:41:31 +01:00
onibot 8a3f8b37e3 floop: strict mask-seed detection + WARNING on seeded answers
His 23/10 review of the merged run found Q1's answer missing from the
stream. Chain, verified against the real code:

1. Q1 ('...does the title "President" refer to in relation to
   PERSON_1?') fired the mask-seed detector's loose mechanism clause —
   any 'refer to' in the sentence, even when the verb governs the
   TITLE, not the placeholder. The seed answered 'Pedro Sanchez' to a
   question that asked which OFFICE 'President' means: wrong semantics,
   a false positive born from the collision of the detector's word
   list with INIT's new hidden-precondition phrasing.

Fixes (both his ask):
- identity_answer STRICT: the mechanism clause now fires only with the
  placeholder as the REFERENT of 'refer(s) to' (regex adjacency, both
  orders). The literal 'who/what is <ph>' clause is unchanged.
- Found while verifying: the literal clause's lookahead accepted
  apostrophes, so 'Who is PERSON_1's predecessor?' (possessive) seeded
  too — the old test only covered 'Who WAS...'. Apostrophe removed from
  the end-of-question char class; possessives never seed again.
- THE SEED IS NOW LOUD: RunStreams.warn() (new channel — WARNING line
  in run.log, [W] on screen ALWAYS, even non-verbose) fires on every
  seeded answer: 'WARNING SEED auto-answered Q1 ... (mask map; zero
  expert calls)'. Self-improvement signal (META): which phrasings the
  seed eats belongs to the lessons bank, and it must be legible that
  the machine auto-answered without any expert.

Also: ARCHITECTURE.md §9-bis — OpenTelemetry observability roadmap
(his future plan ask): run = trace, calls/steps/rows = spans carrying
today's log fields, events.jsonl as the shared bus, warnings as
first-class span events; deferred until the loop hardening settles.

Tests: anonymize +4 assertions (his false positive, possessive trap,
strict positive shapes), machine +1 (seed WARNING lands in run.log).
Suite 17/17.
2026-10-23 16:03:13 +02:00
onibot 4766b47127 floop: INIT told placeholders are resolved + identity seed (his design)
His two-part direction after the PR-16 live run (the model spent a
subquestion asking 'who is PERSON_1?'):

1. INIT desc now says masked entities (PERSON_1, ORGANIZATION_1...) are
   ALREADY-RESOLVED named entities — treat each as a known specific
   entity; do not ask what or who the placeholder is.
2. Safety net: identity_answer() detects a subquestion that ONLY asks
   who/what one placeholder refers to — the mask map already knows. The
   machine seeds it as evidence (engine=mask:seed, verified, zero LLM
   calls) instead of routing it to an expert.

Detection is deterministic and conservative by law: exactly one
placeholder in the text, literal 'who/what is <ph>' (ending there or in
punctuation — possessives like 'who is PERSON_1's predecessor' do NOT
match) or the text names the mask mechanism. Detection runs on the
MASKED text (placeholders still present) before restore.

VERIFIED: tests/anonymize.py 6/6 (seed marking, conservative detection
incl. possessives/comparatives/no-placeholder forms); suite 15/15.
Live E2E (glm-5.3-flash): with the new desc INIT returns exactly the
TWO subquestions he wants (term years + predecessor) — no identity
question, seed unused but armed; run answers Rajoy (E1+E2, 30 calls).
2026-10-22 17:03:44 +02:00
onibot 0ed26d3406 floop: anonymize named entities before INIT (his design)
The model was using its own knowledge of the people in the question
to decide decomposition (his qwen collapsed Pedro Sanchez to ONE
subquestion: 'the question is nearly atomic because I know who he
is'). Structural fix: INIT sees the question's SHAPE, not identity.

- EntityMaskSignature (typed NER proposal): entities as list[NamedEntity]
  (name verbatim + kind) — the typed-output law, no string parsing
- apply_mask/restore_mask: DETERMINISTIC code (LLMs propose, code
  applies): longest names first, one placeholder per surface text,
  typed prefixes PERSON_1/ORGANIZATION_1/..., restore longest-first
  (PERSON_10 never eaten by PERSON_1)
- init_decompose: mask -> INIT -> restore in each returned subquestion;
  MASK finding no entities OR dying (AdapterParseError) -> passthrough,
  never a dead run
- MASK stage in the prompt log (prompts/01-MASK.txt)

VERIFIED: tests/anonymize.py 4/4 (deterministic apply/restore, E2E
mask+restore, no-entity passthrough, mask-death passthrough); suite
15/15. Live E2E (glm-5.3-flash): MASK found exactly Pedro Sanchez
(reasoning explicitly excluded 'President' as a role, not entity);
INIT saw 'Who was the President before PERSON_1?' and returned FOUR
subquestions (identity, office, term start, predecessor) — the shape
split he wanted, plus a 'who is PERSON_1' question; run answers Rajoy
correctly (E1-E4).

OPEN (his question pending): the model now asks WHO the placeholder
is, spending one call per run. Options: (a) keep, (b) desc note that
placeholders are known entities, (c) give INIT the masked question PLUS
the original as context. Not decided — he answers when back.
2026-10-22 16:48:41 +02:00