core/notes/live_probe_2026-05-19.py
Shay fd2fa67b2a docs(notes): live-probe log + reproducer for the 2026-05-19 fluency push
Captures the end-to-end behavior of the gloss-feature landing as a
durable, replayable artifact.  Two files:

notes/live_probe_2026-05-19.py
  Probe script — walks 51 prompts across 13 categories through
  fresh ChatRuntime() instances (cold-start invariant; no vault
  contamination across prompts).  Runs offline / locally:
    uv run python notes/live_probe_2026-05-19.py

notes/live_probe_2026-05-19.txt
  Captured output of the script on commit a8b611a.  Acts as a
  golden-master record: anyone can rerun the script and diff the
  output to detect surface drift.

Categories covered:
  - Cognition (5 prompts)            — truth, knowledge, memory, ...
  - Speech-act / discourse (5)       — fact, idea, statement, ...
  - Mental-state (5)                 — doubt, believe, self, mind, view
  - Adjectives / attitude (5)        — true, important, evident, ...
  - Temporal (5)                     — now, moment, future, before, time
  - Spatial (4)                      — here, place, above, between
  - Action verbs (4)                 — incl. infinitive-stripped form
  - Quantitative (4)                 — all, some, more, enough
  - Causation (4)                    — effect, outcome, consequence, trigger
  - Polarity / frequency (4)         — yes, always, never, maybe
  - Teaching-chain multi-clause (1)  — Why is truth important?
  - Genuinely OOV (3)                — hypothesis, javascript, quasar
  - Cause without teaching chain (2) — How does memory work?
                                       What causes doubt?

Grounding distribution observed:
  pack       45  (88.2%)   fluent gloss-backed surfaces
  oov         3  ( 5.9%)   honest OOV invitations
  none        2  ( 3.9%)   honest "I don't know" (CAUSE w/o chain —
                           deferred SurfaceSelector target)
  teaching    1  ( 2.0%)   multi-clause teaching-chain composition

Sample surfaces:

  [PACK] What is truth?
         Truth is a claim or state grounded by evidence and coherent
         judgment.  pack-grounded (en_core_cognition_v1).

  [PACK] To use means to put something into service for a purpose.
         pack-grounded (en_core_action_v1).

  [PACK] Something is important when it carries weight or priority in
         some judgment context.  pack-grounded (en_core_attitude_v1).

  [PACK] Always indicates the frequency of occurring without exception
         across all instances.  pack-grounded (en_core_polarity_v1).

  [TEACH] truth — teaching-grounded (cognition_chains_v1):
         cognition.truth; logos.core. truth grounds knowledge
         (cognition.knowledge). No session evidence yet.

  [OOV] I haven't learned 'hypothesis' yet (intent: definition).
         Mounted lexicon packs: ...
         Teach me via a reviewed PackMutationProposal.

  [NONE] I don't know — insufficient grounding for that yet.
         (CAUSE on memory — no teaching chain rooted here; the
         deliberate non-fallback the teaching pipeline uses as a
         discovery-gap signal)

No code change in this commit.  Pure documentation artifact for the
fluency-push baseline.
2026-05-19 07:56:24 -07:00

123 lines
3.8 KiB
Python

#!/usr/bin/env python3
"""Live probe script — reproducer for notes/live_probe_2026-05-19.txt.
Walks 51 prompts across 13 categories through fresh ChatRuntime()
instances and prints the rendered surfaces. Deterministic: same code,
same packs, same glosses → byte-identical output every run.
Run:
uv run python notes/live_probe_2026-05-19.py > /tmp/probe.txt
diff notes/live_probe_2026-05-19.txt /tmp/probe.txt
# → no diff (modulo the header comment in the .txt)
"""
from __future__ import annotations
from collections import Counter
from chat.pack_resolver import clear_resolver_cache
from chat.runtime import ChatRuntime
CATEGORIES: dict[str, list[str]] = {
"Cognition": [
"What is truth?", "Define knowledge.", "What is memory?",
"What does meaning mean?", "What is wisdom?",
],
"Speech-act / discourse": [
"What is a fact?", "What is an idea?", "What is a statement?",
"What does claim mean?", "Define argument.",
],
"Mental-state": [
"What is doubt?", "What does believe mean?", "What is the self?",
"Define mind.", "What is a view?",
],
"Adjectives (attitude)": [
"What is true?", "What does important mean?", "Define evident.",
"What is certain?", "What does necessary mean?",
],
"Temporal": [
"What is now?", "Define moment.", "What is the future?",
"What does before mean?", "What is time?",
],
"Spatial": [
"What is here?", "What is a place?", "Define above.",
"What does between mean?",
],
"Action verbs (infinitive-stripped)": [
"What is to create?", "What does make mean?", "What is to use?",
"Define change.",
],
"Quantitative": [
"What does all mean?", "Define some.", "What is more?",
"What does enough mean?",
],
"Causation": [
"What is an effect?", "Define outcome.", "What is a consequence?",
"What does trigger mean?",
],
"Polarity / frequency": [
"What is yes?", "What does always mean?", "Define never.",
"What is maybe?",
],
"Teaching-chain (multi-clause)": [
"Why is truth important?",
],
"Genuinely OOV (honesty control)": [
"What is a hypothesis?", "Define javascript.", "What is quasar?",
],
"Cause without teaching chain (deferred SurfaceSelector target)": [
"How does memory work?", "What causes doubt?",
],
}
_TAGS = {
"pack": "PACK ",
"teaching": "TEACH ",
"oov": "OOV ",
"none": "NONE ",
"vault": "VAULT ",
"partial": "PARTIAL ",
}
def _wrap(surface: str, indent: str = " ", width: int = 78) -> str:
out: list[str] = []
while len(surface) > width:
cut = surface.rfind(" ", 0, width)
if cut == -1:
cut = width
out.append(f"{indent}{surface[:cut]}")
surface = surface[cut + 1:]
if surface:
out.append(f"{indent}{surface}")
return "\n".join(out)
def main() -> None:
clear_resolver_cache()
source_counts: Counter[str] = Counter()
total = 0
for category, prompts in CATEGORIES.items():
print(f"\n=== {category} ===")
for prompt in prompts:
rt = ChatRuntime()
response = rt.chat(prompt)
tag = _TAGS.get(
response.grounding_source,
response.grounding_source.upper().ljust(8),
)
source_counts[response.grounding_source] += 1
total += 1
print(f"\n [{tag}] {prompt}")
print(_wrap(response.surface))
print(f"\n\n{'=' * 70}")
print(f"GROUNDING DISTRIBUTION over {total} prompts:")
for src, count in sorted(source_counts.items(), key=lambda x: -x[1]):
pct = 100.0 * count / total
print(f" {src:10s} {count:3d} ({pct:5.1f}%)")
if __name__ == "__main__":
main()