feat(proof): harvest bounded per-trial Harbor logs - #296
Conversation
Guest summarize now fills trials[].agent_log / verifier_log from Harbor trial dirs (trial.log, then trajectory.json, then terminus_2.pane; verifier/test-stdout.txt), redacted and capped like harbor_run_tail. Co-authored-by: Mathis <echobt@users.noreply.github.com>
*.log is gitignored; keep the Owner retain filename in the summarize fixture via a negation so CI sees the primary agent_log source. Co-authored-by: Mathis <echobt@users.noreply.github.com>
|
@greptileai review Tip vs rebake (Subnet Owner): this harvest is guest-side (
Tipping gateway/challenge/ctx/orch alone does not update |
Keep MAX_RESULTS_BYTES at 256 KiB. 8 KiB × 2 × 33 trials would overflow; agent_log and verifier_log are last-2KiB so a full pack still binds. Co-authored-by: Mathis <echobt@users.noreply.github.com>
|
@greptileai review Architecture follow-up (locked names unchanged):
Guest rebake + Arch RE-LOCK still required after merge; tip CP alone does not update |
Harvest prefers 8 KiB agent_log/verifier_log, shrinks to 4 KiB, then omits bodies so a 33-trial pack still scores instead of TooLarge 503. Job-level harbor_run_tail is unchanged. Co-authored-by: Mathis <echobt@users.noreply.github.com>
Greptile SummaryThe Harbor results changes preserve contract-specific size validation, fit optional per-trial logs within the encoded document budget, and redact decoded log content before selecting output tails. Confidence Score: 5/5Safe to merge. The previously reported generic-contract size-limit issue was manually resolved by echobt without explanation. The previously reported oversized Harbor results issue was manually resolved by echobt without explanation. The previously reported Harbor log secret-tail disclosure issue was manually resolved by echobt without explanation. Files Needing Attention: None. Reviews (8): Last reviewed commit: "fix(proof): redact decoded harbor logs t..." | Re-trigger Greptile |
|
@greptileai review Dig follow-up (locked names unchanged:
|
fit_results_under_cap now re-measures dumps_results UTF-8 bytes after each 8→4→2→omit step so replacement chars and JSON escapes cannot TooLarge a scored Harbor pack. generic-custom-v1 stays on 256 KiB. Co-authored-by: Mathis <echobt@users.noreply.github.com>
|
@greptileai review P1 Keep Results Within Limit — fixed:
P2: Field names / Owner sources unchanged. Guest rebake still required. |
generic-custom-v1 stays at 256 KiB; tbench-harbor-v1 / harbor-trials-v1 get 512 KiB only after contract is identified. Co-authored-by: Mathis <echobt@users.noreply.github.com>
|
@greptileai review P2 Scope Harbor Size Limit — fixed:
Guest summarize still writes ≤ 256 KiB. Field names / Owner sources unchanged. |
read_tail now redacts an overlap window (tail plus longest secret) before taking the last N chars so a credential that straddles the cut cannot leak into agent_log, verifier_log, or harbor_run_tail. Co-authored-by: Mathis <echobt@users.noreply.github.com>
|
@greptileai review P1 Secret Tail Leak — fixed:
Field names, encoded-size fit_results, Harbor-only 512 KiB cap unchanged. Guest rebake still required for live emit. |
read_tail decodes up to 1 MiB from EOF, redacts that text, then keeps the last N characters so a UTF-8 continuation split cannot leak a secret suffix into agent_log, verifier_log, or harbor_run_tail. Co-authored-by: Mathis <echobt@users.noreply.github.com>
|
@greptileai review P1 Secret Tail Leak (UTF-8 remainder) — fixed on
Stay draft until this P1 is cleared. |
|
Threads resolved after Safe to merge 5/5 on 9dd2d13. Please re-run status check so merge can proceed. |
Summary
P0 Mathis / Architecte SN100: Harbor
results.trials[]now carries real per-trial log bodies, not only job-levellogs.harbor_run_log/logs.harbor_run_tail.Guest
summarize.collect_trials/build_resultsharvest Owner-locked metal retain files:agent_logtrial.log, elseagent/trajectory.json, elseterminus_2.pane(agent/terminus_2.panealias);agent/stdout.txtonly if primaries are missingverifier_logverifier/test-stdout.txtlog_sourceslogs.harbor_run_log/logs.harbor_run_tailEncoded-size budget guard (Greptile P1): acceptance is
len(dumps_results(…).encode("utf-8"))of the document we write — not raw field bytes. Invalid UTF-8 replacement chars and JSON escapes can inflate an 8 KiB tail to ~986 KiB. Steps: 8 → 4 → 2 KiB → omit bodies, re-measure after each step. Score still succeeds.harbor_run_tailis not stripped.MAX_RESULTS_BYTESis 256 KiB for every contract, includinggeneric-custom-v1(the 512 KiB figure is only the adaptor-source emit probe, not a results allowance).Log fields stay optional in
validate_harbor(string if present).Tip vs rebake
Guest rebake + Architecte RE-LOCK required. Emit is in-guest
summarize.py. Tipping gateway/challenge/ctx/orch alone does not update/opt/proof/runners.How to verify
python3 deploy/guest/runners/rlm_fc_in_guest_harbor/tests/test_summarize.py ./deploy/scripts/assert-harbor-runner-results-emit.sh cargo test -p proof-resultsIncludes
test_invalid_utf8_and_escapes_use_encoded_json_size(0xFF / high-escape inflation still fits or omits).Greptile
@greptileai reviewTest plan
cargo test -p proof-resultsRisk
Guest-side emit until rebake + RE-LOCK. A pack that still overflows after omit (envelope-only) remains fail-closed
TooLarge.Naming
I did not rename
BASE_*env vars, deployed paths, GHCR names, orbase-*-v1domain tags.