Skip to content

Reconcile main with the installed Python v2 line (keeps Rust v0.2.0) - #4

Merged
Vibherpunk merged 45 commits into
mainfrom
release/reconcile-main-v2-live
Oct 12, 2026
Merged

Vibherpunk merged 45 commits into
mainfrom
release/reconcile-main-v2-live

Conversation

@Vibherpunk

@Vibherpunk Vibherpunk commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Why

main no longer installs the HardTruth that actually runs. GitHub's activity log shows main was force-pushed on 2026-09-25 from ec37706 to 30d9582:

ec37706 (old main, kept as preserve-2026-10-11-hardtruth-fix-div-main) 30d9582 (current main)
Product Python v2 hook + daemon + Tier 2 (merged PR #1, PR #2, tag v2.0.0) Rust v0.2.0 hardtruthd / hardtruth-gate rewrite
install.sh, client/, daemon/app.py present deleted
License MIT LICENSE (PR #1) PolyForm LICENSE.md

After the force-push, the Python line kept going: 30f950c (snapshot of the deployed copy), f2f269d → d19a7e3, 33fb24a (preserve), then fix/tier2-go-offline-db (f4409e9, bf755c1, c59b744). That line is what's installed: ~/.hardtruth/lib/{hardtruth_hook,ast_checker,ledger,tier2_runner}.py match c59b744 byte-for-byte. Note that's c59b744, one commit past bf755c1. Claude Code hooks point at those files. So the Python v2 line is the canonical line for install.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/hardtruth on main, serving ~/dev/vibehard), so it has to be kept too.

What this PR does

Branch = fix/tier2-go-offline-db (c59b744) + a merge of origin/main, with no history rewrite:

  1. Merge 30d9582 (98bba1b):
    • The Rust tree (Cargo.toml, Cargo.lock, src/**) comes in at the root unchanged. cargo check passes at the root and in hardtruth-gate/, which builds alongside it because there's no workspace.
    • The 30d9582 README is kept verbatim as docs/RUST_V0_2_0.md, with a provenance banner. README.md gains a short Repository Layout section.
    • The deletions of client/, daemon/app.py and install.sh are not taken. docker/docker-compose.yml keeps the live Python-daemon config. .gitignore = live entries + target/.
    • The only path main has that this branch lacks is LICENSE.md (see the decision below).
  2. install.sh registers the Claude Code SessionStart hook (8f83c92). d19a7e3 added handle_session_start and the live settings have it, but install.sh never 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) and c59b744 (TEST_DATABASE_URL detection in shared test-helper packages).

Verified

  • Ran install.sh with a throwaway HOME. The installed ~/.hardtruth/lib/*.py are byte-identical to the live install, and the generated Claude Code SessionStart/PostToolUse/Stop entries equal the live ~/.claude/settings.json entries.
  • Every file 30d9582 added 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. 14df40d applies it:

  • The root MIT LICENSE covers the whole repo, Rust v0.2.0 included. PolyForm LICENSE.md is not restored.
  • Cargo.toml (hardtruthd) and hardtruth-gate/Cargo.toml now declare license = "MIT".
  • The docs/RUST_V0_2_0.md banner 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 detached c59b744 worktree (before) and this branch (after), two runs each. Load average was 11–21 during the runs.

Run Result
before #1 3 failed, 191 passed, 8 skipped
after #1 4 failed, 192 passed, 6 skipped
before #2 5 failed, 189 passed, 8 skipped
after #2 4 failed, 189 passed, 9 skipped

No regressions. Apart from install.sh, this PR changes no Python code or tests relative to c59b744; the diff is docs, .gitignore, the Rust sources and install.sh. Every failure below also fails on c59b744.

Failed in every run, before and after:

  • test_tier2_container_mount::TestMacosNativeGateMessage::test_macos_native_project_rejected_with_clear_message_when_not_authorized
  • test_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_reachyd

Intermittent on both trees (load or live-daemon dependent):

  • test_concurrency_load::...::test_concurrent_secret_isolation_and_no_data_leakage
  • test_live::TestSystemOneSentinel::test_20_session_baseline_get_requires_api_token
  • test_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 check passes at the repo root (v0.2.0) and in hardtruth-gate/.

Follow-ups (not in this PR)

  • hardtruth-daemon Docker image is stale. /app/tier2_runner.py in hardtruth-daemon:latest (built 2026-09-23) is the ec37706 version, 685 lines vs 1,288 now. Rebuild it from this branch after merge: docker build -t hardtruth-daemon -f docker/Dockerfile .
  • Other installed copies are pre-fix. ~/.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-running install.sh from this branch syncs them. Not done here, by instruction.
  • install.sh skips 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-fix as canonical, which makes test_14_b6_integrity_check fail from any other checkout.
  • Not merged here: preserve-2026-10-11-hardtruth (9e119f0, uncommitted Rust WIP from ~/dev/hardtruth). It's left untouched. (feat/ledger-integrity's tip 9713d18 predates PR feat: ledger integrity and language-independent gating #2's squash-merge 69b1197, so its work is already in this line.)

🤖 Generated with Claude Code

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.
…tiline shell masking, and polyglot verification
…n tests (50 truths, 50 falsehoods) with 100% accuracy
…test tautology checks, and fast poll reconciliation
- 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
Vibherpunk and others added 15 commits September 24, 2026 21:23
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>
… 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>
@Vibherpunk

Copy link
Copy Markdown
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).

@Vibherpunk
Vibherpunk merged commit d20e13b into main Oct 12, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant