Repository navigation
Reconcile main with the installed Python v2 line (keeps Rust v0.2.0) - #4
Merged
Merged
Conversation
fix: make the gate fail closed and the README true
Comprehensive refactor replacing regex gate with HMAC-SHA256 hash-chained execution ledger, Tier 2 Docker handoff, AST anti-stubbing, and calibrated DeBERTa NLI claim adjudication.
…rule 4a grounding, and ledger locking
…tiline shell masking, and polyglot verification
…6, C9) and harden test suite
…orkspace resolution
…n tests (50 truths, 50 falsehoods) with 100% accuracy
… and singleton architecture
…test tautology checks, and fast poll reconciliation
…n in ledger reconciliation
…cond diff cache, and daemon supervision
…ing, and batch claim verification
…pend, and EOF auto-quarantine
…m pytest target extraction
- Upgrade NLI backbone from DeBERTa-v3 to tasksource/ModernBERT-base-nli - Expand native context window from 512 tokens to 2,048 tokens - Implement strict dynamic label2id index resolution and startup canary validation - Expand ledger premise capacity up to 8,000 characters and stdout tail slices - Bump FastAPI daemon version to 2.0.0 and report active model telemetry - Pin transformers==4.49.0 in requirements.txt and preload in Dockerfile - Incorporate Claude 3.7 Sonnet adversarial architecture review findings - Add comprehensive unit and live inference tests in tests/test_modernbert_nli.py
…low and resilient daemon fallback
Uncommitted changes that were already deployed; captured before fixing Claude Code transcript parsing and Tier 2 verification. Unreviewed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…scoped native host verification - Parse Claude Code JSONL transcripts (tool_use/tool_result pairs, edits, background runs) so bare passing test runs are recognized. - A later bare passing run of the same base command supersedes earlier TAINTED/failed entries (piped runs no longer block a session forever). - Tier 2 targets only projects this session edited; never guesses sibling repos. - Remove duplicate definitions in tier2_runner.py. - Mount cargo workspace root (read-only) for crates inheriting workspace config. - Remove silent Darwin auto-bypass of HARDTRUTH_TIER2_ALLOW_SUBPROCESS; replace with owner-approved scoped native host verification: macOS-native projects, inside ~/dev (HARDTRUTH_TIER2_NATIVE_HOST_ROOTS), edited this session only. Uses the user's rustup toolchain, cargo --offline when cached, 240s bound. Tests: 166 passed; 5 pre-existing env failures (live daemon, torch). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…te portable - Rule 4B: when the NLI daemon is unreachable, an action claim is allowed only if this session already ran tests cleanly. The old exemption for source_files_modified == 0 let bare 'I created and verified X' claims through with zero corroborating activity (test_16, pre-existing). - modernbert tests skip only when torch/transformers are genuinely missing. - test_18 skips only on unverified_no_workspace (daemon can't see the repo). - reachy circuit-breaker tests skip when the sibling repo isn't mounted. - Tier 2 target-resolution tests use hermetic pytest fixtures. Tests: 172 passed, 3 skipped (torch absent), 0 failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ession's edits New 'session_start' hook mode records HEAD + content hashes of already-dirty files for cwd's repo and repos directly under it. A dirty file counts as modified this session only if it wasn't dirty at start or its content changed, so raw-shell edits after start are still caught. No baseline -> old behavior. Idempotent on resume/compact/clear; never blocks. Tests: 7 new pass; full suite 178 passed, 3 skipped; 1 failure is test_reachy_circuit_breaker test_04, which builds reachyd while it is mid-edit on another branch (unrelated). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…it fix, approved + installed)
… on any machine Go modules with dependencies always failed Tier 2: golang:alpine ran with --network none and no module cache. Now the host module cache is mounted read-only (best-effort `go mod download` first), proxy off, toolchain pinned to go.mod, build cache in tmpfs. Tests that read TEST_DATABASE_URL get a throwaway Postgres on a `docker network create --internal` network, always torn down. Go timeout floor 90s; Claude Code Stop hook timeout 90 -> 180 so the hook is never killed mid-gate (which would skip the gate). Pre-existing failures unchanged (5 identical on base and patched). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nly _test files A helper like internal/testdb/testdb.go holds the env read while the _test.go files only call it; detection missed it, so no DB was provided and the tests failed. Scan all source files (vendor/node_modules skipped). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main was force-pushed on 2026-09-25 from ec37706 (Python v2 line: PR #1, PR #2, tag v2.0.0) to 30d9582 (Rust v0.2.0 rewrite, which deleted the Python client/daemon/install.sh). The Python line kept developing and is what runs on the install machine (~/.hardtruth/lib == this tree). This merge keeps the Python v2 line as the installed product and keeps everything 30d9582 added: - Cargo.toml, Cargo.lock, src/ (hardtruthd / hardtruth-gate v0.2.0) at the root, unchanged; builds alongside hardtruth-gate/ (no workspace). - 30d9582's README preserved verbatim as docs/RUST_V0_2_0.md with a provenance banner; README.md gains a Repository Layout section. - .gitignore: live entries plus target/. Deletions of client/, daemon/app.py, install.sh are not taken, and docker/docker-compose.yml keeps the live Python-daemon config. LICENSE.md (PolyForm) stays removed as PR #1 left it; the licensing conflict is flagged in docs/RUST_V0_2_0.md for a decision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d19a7e3 added handle_session_start (pre-session dirty-file baseline) and the live install has the hook wired, but install.sh never registered it, so a fresh install silently lost the baseline. Matcher and timeout match the live ~/.claude/settings.json entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Licensing decision (option a, relayed from Adam via the VibeHard coordinator session): the root MIT LICENSE covers the whole repository, including the Rust v0.2.0 tree. No PolyForm LICENSE.md is restored. - Cargo.toml (hardtruthd) and hardtruth-gate/Cargo.toml: license = "MIT". - docs/RUST_V0_2_0.md banner: Rust code is MIT; the historical README's PolyForm text and LICENSE.md links are superseded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Coordinator: Adam confirmed option (a), MIT for everything, in his coordinator session (2026-10-11 ~22:05 PDT). Pre-merge checks at 14df40d: 8f83c92..14df40d touches only Cargo.toml x2 + docs/RUST_V0_2_0.md; client/, daemon/, tests/ identical to c59b744; installed ~/.hardtruth/lib/*.py byte-identical to the PR's files; full suite 192 passed / 6 skipped / 4 failed (the 3 known pre-existing + test_concurrency_load secret-isolation load flake). Merging with a merge commit (no history rewrite). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
mainno longer installs the HardTruth that actually runs. GitHub's activity log shows main was force-pushed on 2026-09-25 fromec37706to30d9582:ec37706(old main, kept aspreserve-2026-10-11-hardtruth-fix-div-main)30d9582(current main)v2.0.0)hardtruthd/hardtruth-gaterewriteinstall.sh,client/,daemon/app.pyLICENSE(PR #1)LICENSE.mdAfter the force-push, the Python line kept going:
30f950c(snapshot of the deployed copy),f2f269d→d19a7e3,33fb24a(preserve), thenfix/tier2-go-offline-db(f4409e9,bf755c1,c59b744). That line is what's installed:~/.hardtruth/lib/{hardtruth_hook,ast_checker,ledger,tier2_runner}.pymatchc59b744byte-for-byte. Note that'sc59b744, one commit pastbf755c1. Claude Code hooks point at those files. So the Python v2 line is the canonical line forinstall.sh.The Rust v0.2.0 line is a separate product. It isn't an older version of this one. It also runs on the install machine (
~/.local/bin/hardtruthd, built 2026-09-25 from~/dev/hardtruthonmain, serving~/dev/vibehard), so it has to be kept too.What this PR does
Branch =
fix/tier2-go-offline-db(c59b744) + a merge oforigin/main, with no history rewrite:30d9582(98bba1b):Cargo.toml,Cargo.lock,src/**) comes in at the root unchanged.cargo checkpasses at the root and inhardtruth-gate/, which builds alongside it because there's no workspace.30d9582README is kept verbatim asdocs/RUST_V0_2_0.md, with a provenance banner.README.mdgains a short Repository Layout section.client/,daemon/app.pyandinstall.share not taken.docker/docker-compose.ymlkeeps the live Python-daemon config..gitignore= live entries +target/.LICENSE.md(see the decision below).install.shregisters the Claude CodeSessionStarthook (8f83c92).d19a7e3addedhandle_session_startand the live settings have it, butinstall.shnever registered it.Also carries
f4409e9(2026-10-11 blocked-edit hook fix),bf755c1(Tier 2 Go offline module cache, throwaway Postgres on an internal docker network, Stop hook timeout 90→180) andc59b744(TEST_DATABASE_URL detection in shared test-helper packages).Verified
install.shwith a throwawayHOME. The installed~/.hardtruth/lib/*.pyare byte-identical to the live install, and the generated Claude CodeSessionStart/PostToolUse/Stopentries equal the live~/.claude/settings.jsonentries.30d9582added is identical in this branch.Licensing: MIT for everything
Decided as option (a). The decision was relayed from Adam by the VibeHard coordinator session, and Adam should confirm it here before merge.
14df40dapplies it:LICENSEcovers the whole repo, Rust v0.2.0 included. PolyFormLICENSE.mdis not restored.Cargo.toml(hardtruthd) andhardtruth-gate/Cargo.tomlnow declarelicense = "MIT".docs/RUST_V0_2_0.mdbanner states the Rust code is MIT and the historical PolyForm text is superseded.Tests
Full suite (
python3 -m pytest tests/, 202 tests), run alternately on a detachedc59b744worktree (before) and this branch (after), two runs each. Load average was 11–21 during the runs.No regressions. Apart from
install.sh, this PR changes no Python code or tests relative toc59b744; the diff is docs,.gitignore, the Rust sources andinstall.sh. Every failure below also fails onc59b744.Failed in every run, before and after:
test_tier2_container_mount::TestMacosNativeGateMessage::test_macos_native_project_rejected_with_clear_message_when_not_authorizedtest_v21_hardening::TestV21Hardening::test_14_b6_integrity_check(canonical path hardcoded to~/dev/hardtruth-fix)test_reachy_circuit_breaker::TestReachyCircuitBreaker::test_04_run_independent_verification_reachydIntermittent on both trees (load or live-daemon dependent):
test_concurrency_load::...::test_concurrent_secret_isolation_and_no_data_leakagetest_live::TestSystemOneSentinel::test_20_session_baseline_get_requires_api_tokentest_adversarial_evasion::test_3_workspace_traversal_safety: a <2s wall-clock assertion at line 177. It failed in after feat: ledger integrity and language-independent gating #2, and in isolated reruns it failed 1 of 6 on before and 2 of 6 on after.test_fail_closed_claim_verification(3 tests): these are the 3 in the known-failures list. They fail when run as a subset and passed in these full runs.Rust:
cargo checkpasses at the repo root (v0.2.0) and inhardtruth-gate/.Follow-ups (not in this PR)
hardtruth-daemonDocker image is stale./app/tier2_runner.pyinhardtruth-daemon:latest(built 2026-09-23) is theec37706version, 685 lines vs 1,288 now. Rebuild it from this branch after merge:docker build -t hardtruth-daemon -f docker/Dockerfile .~/.hardtruth/lib/hardtruth/{hardtruth_hook,tier2_runner}.py, used by the package import path and the pre-commit gate, and~/.gemini/config/hardtruth_hook.py, used by Antigravity, are still the pre-2026-10-11 hook. Re-runninginstall.shfrom this branch syncs them. Not done here, by instruction.install.shskips the Stop hook when an entry already exists, so the 90→180 timeout only applies to fresh installs.check_hook_integrity()hardcodes/Users/ai/dev/hardtruth-fixas canonical, which makestest_14_b6_integrity_checkfail from any other checkout.preserve-2026-10-11-hardtruth(9e119f0, uncommitted Rust WIP from~/dev/hardtruth). It's left untouched. (feat/ledger-integrity's tip9713d18predates PR feat: ledger integrity and language-independent gating #2's squash-merge69b1197, so its work is already in this line.)🤖 Generated with Claude Code