A time in no particular zone, and a preview missing what it previews

The first audit pass: everything from 0.8.1 to 0.9.8 read as a whole rather
than one feature at a time, starting with what a model is actually told.

Four of these had shipped as correct. The date line carried a timezone
variable that resolves to nothing until somebody chooses one -- so every
default account was told times were "in  unless they say otherwise", while
two comments asserted the line disappeared instead. The prompt preview
built its variables without a chat, which is what eleven fragments are
gated on, so the whole agent surface was absent from it whatever was
ticked. Plan mode was instructed to keep its plan current with a tool that
mode withdraws. And knowledge_get returned a document whole where every
sibling reader caps and says so, its description promising exactly that.

The subagent guidance was wrong in both directions at once: it denied a
documented parameter and named seven of twenty-three allowed commands.
Both halves are pinned by tests against the real list and the real schema
now, because prose and a constant drift the moment one is edited alone.

docs/notes/audit-0.9.md carries the findings that are not fixed here, with
why -- the ones whose fix would change what a feature does are the user's
call, not this pass's.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-07 09:13:54 +02:00
parent d201521353
commit 3afbccba81
14 changed files with 752 additions and 51 deletions
+31
View File
@@ -37,6 +37,37 @@ def test_no_tools_means_no_tool_guidance(db, owner):
assert harness.compose(db, owner, None) == text
def test_the_date_line_names_a_zone_when_nobody_has_chosen_one(db, owner):
"""The shipped default, on the shipped configuration.
`clock.name_for` returns "" for an account that has never chosen a zone,
which is every account until somebody visits the settings page. The variable
sits *inside* a sentence, and `substitute` drops a line only when the whole
line is blank after expansion -- so an unresolved zone was never a dropped
line, it was "in unless", shipped on every request. Both the comment in
`harness.py` and the fragment's own hint claimed otherwise, and no test
asked.
"""
assert not (owner.settings_json or {}).get("timezone")
text = harness.compose(db, owner, [])
line = next(ln for ln in text.splitlines() if "Times the person gives you" in ln)
assert "in unless" not in line
assert " " not in line
# Whatever the host is set to, it has to be *something*.
zone = line.split(" are in ", 1)[1].split(" unless", 1)[0]
assert zone.strip()
def test_the_date_line_uses_the_readers_own_zone_when_they_have_one(db, owner):
"""And a chosen zone is preferred to the server's, which is the whole point
of the variable -- the fallback must not have flattened it."""
owner.settings_json = {**(owner.settings_json or {}), "timezone": "Pacific/Auckland"}
db.commit()
text = harness.compose(db, owner, [])
assert "are in Pacific/Auckland unless" in text
def test_clearing_the_core_fragments_restores_an_empty_harness(db, owner):
"""The behaviour change is a default, not a rule: an administrator who wants
nothing sent to a tool-less model can still have exactly that."""