phase: 119_name_signal_read_chips
All verification complete. Final report: **Phase 119 final verification pass — all criteria verified, one stale pin fixed.** - Verified implementation of all 6 tasks: D1 component name-hit rule (`name_hit` flag, titles never matched, retired length tie-break), D2 `BOR_NAME_HIT_BONUS` (0.005 default, 0 = byte-identical kill switch, negative fails startup, selection-layer only, `eval_retrieval` `suggested:` line), D3 suggested-folder lines (after `SUGGEST_INTRO`, before first block), D4 cite-discipline `SUGGEST_INTRO` sentence (PERSONA/LOW/`TOOLS_SECTION` byte-pins intact), D5 `done.sources` = read docs only (frontend no-op on empty confirmed), D6 mock `repeat your folder map` echo + new suite + telemetry. - Battery (replica restored per skill, fingerprint docs=1000/chunks=8866 verified, `eval_retrieval --from-file tests/fixtures/retrieval_battery.txt` re-run): **GATE PASS** — gitea README #4 in suggested top-5, forgejo 5/5 (README #1), gateway README in top-5 (#4), qwen3.8-27b quadlets top-5, Mongolia HIGH/fts=5 unchanged. - New E2E in isolation: `4 passed` ×2 (deterministic). All 27 modified E2E suites in isolation: 26 green; **1 stale pin fixed** — `test_source_chip_quality.py` durable-record order pin pre-dated the D1 re-rank (`aliases` stem sub-component name-hits `ssh_aliases.txt`, deterministically lifting `backups.md` over `kubernetes.md`; probe-verified 0.016277 vs 0.016036, 4/4 stable) — re-pinned with the phase-119 rationale; suite green ×2. - Gates: `uv run pytest --cov=app --cov-report=term-missing` → **2547 passed, app coverage 99%** (>90%); `uv run ruff check .` → All checks passed; `uv run pyright` → 0 errors. - Completion criteria: 1 ✅ (battery, recorded), 2 ✅ (folder lines; block/LOW byte-identical pins green), 3 ✅ (read-only chips, zero-read chips nothing, related row + durable record untouched — unit+E2E agree), 4 ✅ (all green), 5 → commit/phase-move left to the harness per pass rules (nothing committed). - Deviations: battery output + real-model telemetry recorded in `.agents/reports/119_name_signal_read_chips/task06_battery_and_e2e.md` and `TOOL_CALLING_TESTING.md` §11 (task files in `complete/` are immutable to this pass); gateway canonical doc at #4 vs overview's #3 was already documented at task 06 (containment gate met). - Next pending phase: **none** — `todo/` holds only phase 119.
This commit is contained in:
@@ -436,6 +436,29 @@ Implements just enough of the aipi surface:
|
||||
phrases — the phase-71/72/94 ordering convention); verified
|
||||
2026-09-16: no existing E2E question or fixture file contains the
|
||||
phrase, so every other suite is unaffected.
|
||||
- user message containing ``repeat your folder map``
|
||||
(``FOLDER_MAP_TRIGGER``, phase 119, D3 — the suggested-folder
|
||||
context's story suite ``tests/e2e/test_name_signal_read_chips.py``)
|
||||
**and** the system prompt contains the ``<documents>`` section ->
|
||||
the composed answer ends with `` (folders: <line 1>; <line 2>; …)``
|
||||
echoing the suggested-folder lines VERBATIM — the plain lines
|
||||
between ``SUGGEST_INTRO`` and the first ``<document `` in the
|
||||
``<documents>`` section (``app.rag.prompts.build_high_prompt`` /
|
||||
``app.rag.agent.suggested_folder_lines``, phase 119 LOCKED A4:
|
||||
``<source>/<prefix>/: e1, e2, …``), joined with ``; ``. If no
|
||||
folder lines are present (empty *folder_lines* — the
|
||||
byte-identical phase-118 shape) the echo is omitted and the answer
|
||||
is otherwise unchanged. The same prompt-injection-echo convention
|
||||
as the ``<tuning>`` / ``<knowledge_base>`` triggers above (a SUFFIX
|
||||
appended after both, so the folders suffix is the last thing
|
||||
rendered): phase 119 D3's observability — the folder lines land in
|
||||
the model's prompt only on grounded turns, and the echo is the
|
||||
E2E's deterministic lens on their EXACT text (line identity shape
|
||||
+ entry order + the owning-doc exclusion + the caps). It composes
|
||||
with any base answer (it does not compete with a marker branch);
|
||||
the trigger phrase is disjoint from every other trigger's; verified
|
||||
2026-09-16: no existing E2E question or fixture file contains the
|
||||
phrase, so every other suite is unaffected.
|
||||
|
||||
Failure injection (phase 67, LLM retry, TODO.md L3) — deterministic
|
||||
dead-endpoint behavior for the retry E2E suite (``tests/e2e/
|
||||
@@ -675,6 +698,17 @@ TABLE_TRIGGER = "show me a table"
|
||||
#: phrase, so every other suite is unaffected.
|
||||
HISTORY_TRIGGER = "echo my history"
|
||||
|
||||
#: Phase 119 (D3, the suggested-folder context's story suite): a user
|
||||
#: message containing this substring (case-insensitive) — combined
|
||||
#: with the ``<documents>`` section in the system prompt (a grounded
|
||||
#: turn) — gets the composed answer suffixed with the folder lines
|
||||
#: VERBATIM (`` (folders: <line 1>; <line 2>; …)``, joined with
|
||||
#: ``; ``; omitted when the section carries no folder lines) — see the
|
||||
#: module docstring. Disjoint from every other trigger phrase; verified
|
||||
#: 2026-09-16: no existing E2E question or fixture file contains the
|
||||
#: phrase, so every other suite is unaffected.
|
||||
FOLDER_MAP_TRIGGER = "repeat your folder map"
|
||||
|
||||
TABLE_ANSWER = (
|
||||
"Here's the shape, in a table:\n"
|
||||
"\n"
|
||||
@@ -1657,6 +1691,32 @@ def first_kb_bullet(system: str) -> str | None:
|
||||
return None
|
||||
|
||||
|
||||
def folder_map_lines(system: str) -> list[str]:
|
||||
"""The suggested-folder lines of the ``<documents>`` section
|
||||
(phase 119, D3, LOCKED A4) — or ``[]`` when there are none.
|
||||
|
||||
``build_high_prompt`` lays the section body out as ``SUGGEST_INTRO``
|
||||
(line 1), the folder lines (each on its own line, immediately after
|
||||
the intro line), a blank line, then the first ``<document>`` block
|
||||
— so the lines are exactly the non-blank lines between the intro
|
||||
line and the first ``<document `` line of the block. With no folder
|
||||
lines (the byte-identical phase-118 shape) there is only the blank
|
||||
line there, and this returns ``[]`` (the echo is then omitted — the
|
||||
answer is otherwise unchanged).
|
||||
"""
|
||||
block = _DOCUMENTS_BLOCK_RE.search(system)
|
||||
if not block:
|
||||
return []
|
||||
lines = block.group(0).splitlines()
|
||||
out: list[str] = []
|
||||
for line in lines[2:]: # skip the tag line + the SUGGEST_INTRO line
|
||||
if line.lstrip().startswith("<document"):
|
||||
break
|
||||
if line.strip():
|
||||
out.append(line)
|
||||
return out
|
||||
|
||||
|
||||
def _history_echo(body: dict[str, Any]) -> str:
|
||||
"""The phase-74 history echo (byte-stable, stateless over messages).
|
||||
|
||||
@@ -2093,6 +2153,18 @@ def compose_answer(body: dict[str, Any]) -> str:
|
||||
bullet = first_kb_bullet(system)
|
||||
if bullet:
|
||||
answer = f"{answer} (kb: {bullet})"
|
||||
# Suggested-folder context (phase 119, D3, LOCKED A4): when the user
|
||||
# message carries FOLDER_MAP_TRIGGER and the system prompt carries
|
||||
# the <documents> section, the answer ends with the folder lines
|
||||
# VERBATIM (joined with "; ") — the E2E's deterministic lens on the
|
||||
# exact lines build_high_prompt seeded (D3 observability; the same
|
||||
# prompt-injection-echo convention as the two echoes above). Omitted
|
||||
# when the section carries no folder lines (the byte-identical
|
||||
# phase-118 shape) — the answer is otherwise unchanged.
|
||||
if FOLDER_MAP_TRIGGER in user.lower() and "<documents>" in system:
|
||||
folder_lines = folder_map_lines(system)
|
||||
if folder_lines:
|
||||
answer = f"{answer} (folders: {'; '.join(folder_lines)})"
|
||||
return answer
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user