test: add unit tests for 8 modules (batch 2) - #62
Conversation
Cover model_tools, toolset_distributions, context_compressor, prompt_caching, cronjob_tools, session_search, process_registry, and cron/scheduler with 127 new test cases.
test: add unit tests for 8 modules (batch 2)
…sResearch#62, NousResearch#64) Adds three pre-write-txn gates in `complete_task` mirroring the existing `_verify_created_cards` / `HallucinatedCardsError` pattern: - `verify_runtime_floor` (closes hermes-jarvis#64) — per-role floor on completed_at - started_at. Build 5min, review 90s, orchestration 0. - `verify_workspace_diff` (closes hermes-jarvis#62) — non-review workers on dir/worktree workspaces must produce a non-empty git diff against the tracking base. - `verify_no_stray_artifacts` (closes hermes-jarvis#28) — rejects *evidence*, commit-hash*, triage/*, tmp-*, and untracked no-extension/no-shebang files (the agent-dashboard PR #1 "all prior block evidence files" failure mode). Opt-outs via metadata (x_fast_justified / x_no_code / x_stray_ok) require ≥20-char string reasons and emit completion_opt_out_used audit events with verbatim reason. Truthy bools or short strings rejected with InvalidOptOutError. Context: hermes-jarvis#61 (bootstrap-paradox case study). 41 tests pass; 258 wider regression — zero failures. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Validation complete. All 887 V2 tests pass. Issue #53 transcript replay passes all 4 scenarios in stub mode. Approval/risk manager and response finalizer invariants verified live. Full execution path documented. Verdict: V2 usable but needs hardening. Deliverable: Hardening needed before full production use:
No architecture gaps found. Commit: d3c9d49e6. |
|
Validation complete. All 887 V2 tests pass. Issue #53 transcript replay passes all 4 scenarios in stub mode. Approval/risk and response-finalizer invariants verified live. Verdict: V2 usable but needs hardening. Deliverable: Hardening needed before full production use:
Commit: d3c9d49e6. |
test: add unit tests for 8 modules (batch 2)
…ousResearch#62) Found the ACTUAL root cause of DAN-1639 (previous commit's if:/concurrency guard was a red herring — the file was never valid YAML to begin with). Lines 76-80 (the git commit -m multi-line message body: '- Applied ruff auto-fixes' etc.) had zero indentation, breaking out of the run: | block scalar (which requires content indented deeper than the run: key, >=10 spaces here). YAML parsed the dedented '- Applied ruff auto-fixes' as an illegal top-level sequence item inside a mapping context. This means the workflow file has been invalid YAML since it was authored (commits 60c1a3b / 0de4f0d) — GitHub can't parse the on: pull_request trigger at all, so it reports a synthetic startup_failure on every push that re-validates workflow files repo-wide, which is why every recorded run shows event=push with zero jobs, never a real pull_request trigger. Verified: python3 -c 'import yaml; yaml.safe_load(...)' now parses cleanly; the dedented shell content inside the run block is byte-identical to before (only YAML structural indentation changed, not the actual git commit message text ci-auto-fix produces). Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Summary
model_tools,toolset_distributions,agent/context_compressor,agent/prompt_caching,tools/cronjob_tools,tools/session_search_tool,tools/process_registry,cron/scheduler_scan_cron_promptregex (fix PR to follow)Test details
model_toolstoolset_distributionsagent/context_compressoragent/prompt_cachingtools/cronjob_toolstools/session_search_tooltools/process_registrycron/schedulerBug found
_scan_cron_promptregex for prompt injection (ignore\s+(previous|all|above|prior)\s+instructions) only allows ONE word between "ignore" and "instructions". Multi-word variants like "Ignore ALL prior instructions" bypass the scanner. Fix PR to follow.Test plan