A gate keyed on a stored instruction verifies nothing
Source: clawd scripts/vix_portfolio_advisor.py + scripts/nexus_daily_recommendations_report.py, 2026-09-20.
What was wrong
The trade-recommendation block was lifted by a substring test against the holdings file's
own source field:
if "verify against latest brokerage" in source.lower():
warnings.append("holdings restored from memory require brokerage verification")
That field read: "Restored from ... on 2026-04-28. Verify against latest brokerage screenshots before trading." So the gate tripped on a note asking for verification, not on any verification having happened.
The consequences are worse than a stuck warning:
- The note is in the data the gate reads. Editing that sentence removes the warning. Any operator, script or agent that touches the holdings file can silently unblock trade recommendations without checking a single holding against a statement.
- It can never clear honestly. A gate whose only input says "please verify" reports the same state forever, so it looks like live judgement when it is a constant.
- It mislabels. The report said holdings were "stale/unverified" while
last_price_updatewas 08:31 the same morning and every snapshot carriedstale: false. Prices were fresh; only quantities were unverified.
The rule
A verification gate must be lifted by evidence that verification occurred, never by a stored request for it.
Concretely, the replacement reads a separate dated record and requires all three:
record["verified_at"] within VERIFICATION_MAX_AGE_DAYS
record["source"] present
record["quantities"] == flattened holdings on disk
Now the only way to unblock is to produce a dated brokerage record whose share quantities match the holdings. Editing the holdings note does nothing, which is the property a gate needs.
Check for this class
- Does the gate read the same object it is guarding? If yes, the guard is self-referential.
- Would editing a comment, note, or
sourcestring change the verdict? If yes, the gate is decorative. - Does the blocked state ever clear on its own? A gate that cannot clear is probably a constant, not a check.
- Does the message name the real deficiency? "Stale" when prices are fresh and only quantities are unverified sends the reader to fix the wrong thing.
Companion defect in the same run
nexus_daily_recommendations_report.py carried a copy of the same substring test. Two
copies of a gate drift. Nexus now imports verification_is_current and
current_quantities from the advisor, so there is one implementation. Importing between
sibling scripts in the same directory is safe when the module has no import-time side
effects; verify that before wiring the import.