Validate file-contract alignment between NovaTrade state-file producers and autonomy collector consumers to prevent silent health-score degradation.
Preventive validation skill that detects silent degradation in autonomy pipeline health checks caused by mismatches between state-file producers (NovaTrade runtime writers) and consumers (autonomy collector readers).
Autonomy collectors (e.g., PipelineCollector) expect specific state files to exist at known paths. When those files are never written by the runtime, collectors silently fall back to generic low-confidence scoring — making the system appear degraded when it is actually healthy. This is a contract mismatch, not a real health issue.
novatrade/autonomy/collectors/ or novatrade/runtime/Read each collector in novatrade/autonomy/collectors/ and extract every file path it attempts to open, along with the scoring weight and fallback behavior.
Target files:
novatrade/autonomy/collectors/pipeline.py
novatrade/autonomy/collectors/risk_engine.py
novatrade/autonomy/collectors/*.py
For each file reference, record:
STATE/novatrade/connection_status.json)Search the NovaTrade runtime for all state-file write operations:
Target directories:
novatrade/runtime/
novatrade/monitor/
novatrade/execution/
novatrade/data/
Search patterns:
write_text, json.dump, os.replace into STATE/ paths_persist_* methodsPath(...) construction targeting STATE/novatrade/For each write site, record:
Cross-reference consumers and producers into a matrix:
| Expected File | Consumer | Weight | Producer | Status |
|---|---|---|---|---|
| connection_status.json | PipelineCollector | 40 pts | — | MISSING |
| live_metrics.json | PipelineCollector (fallback) | 50 pts | live_loop._persist_signal_metrics | OK |
Mark each entry as:
For each MISSING or STALE entry, calculate:
Flag entries where:
For each gap, recommend one of:
Run a quick live validation:
# Check which expected files actually exist
for f in connection_status.json feed_health.json last_order_attempt.json live_metrics.json signal_stats.json; do
path="STATE/novatrade/$f"
if [ -f "$path" ]; then
age=$(($(date +%s) - $(stat -c %Y "$path")))
echo "OK: $path (age: ${age}s)"
else
echo "MISSING: $path"
fi
done
Compare live state against the contract matrix to confirm findings.
novatrade/autonomy/collectors/ source filesnovatrade/runtime/, novatrade/monitor/ source filesSTATE/novatrade/ directorySTATE/novatrade/ does not exist: report as infrastructure issue, not contract gapThese were identified and fixed in task 0659:
connection_status.json — consumed by PipelineCollector, never produced → fixed with explicit live_metrics fallbackfeed_health.json — consumed by PipelineCollector, never produced → fixed with signal_stats fallbacklast_order_attempt.json — consumed by PipelineCollector, never produced → fixed with fallback chainThe fix pattern: add fallback scoring using files that ARE produced (live_metrics.json, signal_stats.json) rather than waiting for files that may never exist.