# Project export: Halba

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: OpenAI Build Week
- Tagline: Language proposes. Evidence decides. The local-first trust operations control plane.
- Devpost: https://devpost.com/software/halba
- GitHub: https://github.com/jlekerli-source/halba
- Demo: https://jlekerli-source.github.io/halba/
- Video: https://www.youtube.com/embed/5wuC21fJVdo?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 1 GitHub contributor(s) — jlekerli-source (10 commits)

## Devpost submission (written by the team)

### Inspiration

AI coding agents can produce impressive work, but the final update often compresses a messy run into confident prose. The expensive part is no longer generating the change—it is finding out which claims are supported, stale, contradicted, or still need a person. The original prompt was inspired by Theo Browne's “I don't have time to build these things, will you?”, which called for a Slack alternative that works for agents. Halba is an independent interpretation: not another agent chat surface, but the proof layer after the run. There is no affiliation or endorsement.

### What it does

Halba turns risky completion claims across local workspaces into one Trust Inbox. Deterministic evidence policy ranks contradictions, unsupported or stale proof, changed evidence, expired decisions, degraded imports, failed guards, and dependency impact. Every item says why it matters now and routes to the exact claim, run, or import receipt. Model prose has zero ranking or approval authority. The queue opens into Proof Mode, where one bounded evidence identity stays visible from claim to source to guard to human decision. A public-safe Codex run shows what the agent inspected, changed, checked, and claimed before the material claims enter that loop. Proof Mode imports the bounded agent report, source files, and machine receipts. GPT-5.6 extracts atomic claims and precise citations. Halba validates every source reference, applies deterministic guards, and assigns one of five verdicts: supported, unsupported, stale, contradicted, or uncertain. The user sees: what changed; what is actually verified; what is missing or stale; what conflicts with deterministic evidence; which claims require human review. Every claim opens to its exact evidence boundary: source-backed claims show the cited lines and content hash, while missing evidence is exposed as an explicit missing-source state. Proof Mode also preserves the model's reasoning boundary and deterministic guard results. A human can approve, reject, resolve, or request more proof with a local audit note. Closed gates reduce channel attention; requesting proof intentionally leaves the gate open.

### How we built it

Halba is a dependency-free Node.js application with a static browser frontend. Proof bundles are local JSON plus source files. The server rejects absolute paths, traversal, undeclared files, symlinks, oversized inputs, and invalid line ranges. The workspace contract validates safe ids, channel/agent/thread references, timestamps, typed event names, proof-bundle linkage, and a 64 KB input ceiling. Bounded Codex-session, CI-manifest, and release-manifest adapters normalize into the same local contract. They do not store raw transcripts or arbitrary command output, and they cannot create lineage or approval authority. Codex accelerated the Build Week delta end to end: baseline and privacy auditing, Proof Mode implementation, deterministic guards, the eval corpus, rendered frontend iteration, the Remotion film, Docker verification, and public release automation. The most important decisions were to keep evidence local, separate inference from proof authority, label recorded versus live execution, and reserve unresolved decisions for a human. The public demo includes a safe version of the Codex-authored report, diff, and receipts it was built to inspect. The live inference path uses the OpenAI Responses API with gpt-5.6-sol, max reasoning, strict Structured Outputs, and store: false. Model output is never authoritative by itself. The adjudicator checks exact quotes and runs deterministic receipt, freshness, JSON-field, and required-citation guards before producing a verdict. The public Pages demo uses synthetic evidence and a clearly labeled structured-inference fixture so judges can reproduce the full workflow without providing credentials. It is not presented as evidence of a live GPT request. The Node and Docker paths retain the optional live integration, which fails closed when it is not configured or returns an invalid model response. Challenges The hardest design problem was separating inference from proof. It is tempting to let a strong model act as the judge. Halba instead treats model output as untrusted structured input and preserves deterministic authority where the source can answer directly. Public release preparation was also a product problem. The pre-existing local app contained private adapters and data. We created a strict allowlist, a secret/path audit, and a clean-room packaging check that rebuilds the release tree and reruns checks, smoke tests, and evals from that tree. Accomplishments One legible end-to-end workflow from agent report to human decision. One ranked cross-workspace Trust Inbox for changed evidence, failed guards, expired decisions, degraded imports, and downstream risk. Exact-source grounding instead of opaque confidence scores. Deterministic guards that can override model overconfidence. A regression corpus spanning every verdict, malformed output, prompt-like evidence, stale boundaries, false positives, and failed receipts. A responsive desktop/mobile review surface built for a short live demo. A Slack-style agent workspace with proof-driven attention and typed Codex run events. Three bounded run adapters—Codex session metadata, structured CI receipts, and release packets—plus one validated workspace contract. A downloadable review record that preserves exact source hashes, guard outcomes, and human decisions. A dependency-free product runtime inside a reproducible, privacy-audited public release. A current captioned 72-second Trust Operations film whose Remotion source, narration, captions, and original sound bed are checked in; it explicitly explains how Codex accelerated the build and how GPT-5.6 is used inside Halba.

### What we learned

The useful boundary is not “AI versus rules.” GPT-5.6 is excellent at turning an unstructured completion report into testable claims. Rules are excellent at answering narrow questions about receipts, dates, and exact source text. The trustworthy product comes from showing where each one stops.

### What's next

Measured operator studies for comprehension, prioritization quality, and weekly-review usefulness. Additional deterministic guard classes where real imported evidence demonstrates a repeated need. Identity-aware signatures only after the authorship and trust model is explicitly defined; current hash chains prove integrity, not identity. More live-model eval runs with published latency, token usage, failure distributions, and no replay-derived quality claims. Built with OpenAI Responses API, GPT-5.6 Sol, Codex, Node.js, HTML, CSS, JavaScript, local JSON, SQLite, Docker, GitHub Pages, isolated Chromium/CDP browser verification, and Remotion for the submission film. Contribution I designed and built Halba’s local-first Trust Operations system and Proof Mode: the bounded run adapters, evidence policy, exact-source adjudication, deterministic guards, evals, responsive UI, privacy hardening, packaging, and deployment—with Codex as my implementation partner.

## README (from the GitHub repository)

# Halba

Halba is a local-first trust operations control plane for AI-assisted work.

Its **Trust Inbox** turns risky completion claims across local workspaces into one deterministic queue. It explains why each item matters now, then routes the reviewer to the exact claim, import receipt, guard result, or human decision. Model prose has zero ranking or approval authority.

From that queue, **Proof Mode** opens one bounded evidence identity. GPT-5.6 extracts claims and precise citations; deterministic guards check the actual bytes; a human approves, rejects, resolves, or requests more proof without rewriting the evidence.

Halba is not a chatbot or a human Slack clone. Language proposes. Evidence decides. The human remains accountable.

![Halba Trust Inbox ranking a contradictory release claim across three local workspaces](artifacts/screenshots/trust-inbox-desktop.png)

## Try the public demo

- Public demo: [jlekerli-source.github.io/halba](https://jlekerli-source.github.io/halba/)
- Build Week submission: [devpost.com/software/halba](https://devpost.com/software/halba)
- Published film mirror: [jlekerli-source.github.io/halba/demo/halba-demo.mp4](https://jlekerli-source.github.io/halba/demo/halba-demo.mp4)
- Current 72-second Trust Operations candidate: [`artifacts/demo/halba-demo.mp4`](artifacts/demo/halba-demo.mp4)
- Source: [github.com/jlekerli-source/halba](https://github.com/jlekerli-source/halba)

Requirements: Node.js 22.5 or newer. Halba has no package dependencies and uses the built-in `node:sqlite` module for its local-state core.

```bash
npm run check
npm start
```

Open [http://localhost:4177](http://localhost:4177), then open the Proof handoff in `#halba-build-week`. To exercise Trust Inbox with the synthetic three-workspace benchmark, follow the durable-state commands below. `pnpm` works in place of `npm`.

The default demo is synthetic and public-safe. Its structured-inference fixture is visibly labeled **Recorded** and makes no OpenAI request. GitHub Pages proves the read-only workspace and Proof Mode flow in the browser. Trust Inbox requires the locally seeded durable runtime; current screenshots and isolated Chromium checks prove that surface. The Node and Docker paths retain the optional live Responses API endpoint.

## Agent workspace

The public demo contains three channels, three agents, and four selectable runs. Use **Attention** to see only work with unresolved human gates, browse a channel or agent scope, filter by run state, or search event details. The selected scope, filter, query, and run persist locally across reloads.

The proof-ready Codex run in `#halba-build-week` appears as four typed events: source indexing, a file change, deterministic receipts, and a completion-claim handoff. Opening that handoff enters Proof Mode. Other completed or in-progress runs show their own local receipts and never borrow evidence from the proof-ready run.

**Import workspace JSON** accepts a bounded Halba workspace from disk, validates ids, references, counts, timestamps, event boundaries, and proof linkage in the browser, and keeps the imported data only for the current session. It never uploads the file.

The checked-in workspace is generated from the existing public-safe Codex completion report, bounded proof bundle, receipts, and recorded adjudication:

```bash
npm run import:codex-demo
npm run check:codex-import
```

The importer does not scrape private transcripts. It uses the same public-safe packet that judges can inspect, validates the normalized workspace, and produces `data/demo/workspace.json` deterministically.

## Durable local state

The local state core stores validated workspaces, typed runs, immutable proof revisions, content-addressed source bytes, bounded receipt projections, append-only import and decision history, and evidence-scoped current decisions in SQLite:

```bash
npm run state -- init
npm run state -- status
npm run state -- backup backups/halba.sqlite
HALBA_STATE_FILE=.halba/halba.sqlite npm start
npm run review:weekly -- --state .halba/halba.sqlite --output reviews/weekly.md
```

The server enables durable mode only when `HALBA_STATE_FILE` is set. In that mode the browser loads canonical workspaces and bundle-specific adjudications from SQLite, verifies exact source hashes before rendering, and persists evidence-scoped review decisions across restarts. Imported source bytes are verified and copied into the SQLite backup boundary, so exact-source inspection survives relocation without the original source root. The server binds to `127.0.0.1` by default and refuses non-loopback binding without explicit remote-access configuration. Without durable mode, the public-safe recorded demo remains the default. The database is ignored by Git and excluded from public artifacts. Restore refuses to overwrite an existing state file unless explicitly requested. See [`docs/local-state.md`](docs/local-state.md).

## Import real agent runs

Import a bounded Codex rollout without storing transcript bodies or command text:

```bash
npm run import:run -- \
  --adapter codex \
  --manifest path/to/codex-run.json \
  --source path/to/rollout.jsonl \
  --bundle path/to/bundle.json \
  --proof-output path/to/proof-output.json \
  --dry-run \
  --state .halba/halba.sqlite
```

The preview prints a zero-write JSON plan and full plan digest. Remove `--dry-run` to commit, or pass that digest back with `--expect-plan-digest` to require the inspected plan to remain identical. The bounded `ci` and `release` adapters derive authority from structured checks; release packets additionally require an explicit artifact `--root`. The older `manifest` adapter remains compatibility-only routing evidence. All adapters normalize into the same workspace/run contract and use one transactional commit boundary. See [`docs/run-import.md`](docs/run-import.md).

Durable mode analyzes claim history without rewriting prior adjudications: newer same-agent/channel claim identities supersede older packets, and supported proof becomes an attention item after its configured age window or when a newer run advances past it. The workspace exposes that queue and can download a weekly Markdown evidence review covering runs, failures, open gates, stale claims, human decisions, and import digests.

Evidence-policy v2 is an optional, backward-compatible workspace contract for operator- or adapter-declared stable claim keys, explicit supersession, criticality, required deterministic guards, dependencies, freshness, and decision expiry. The durable Trust Inbox evaluates all local workspaces into one ranked attention model, explains every `why now` reason and score component, filters common risk classes, saves a local review checkpoint, and routes claims into exact Proof Mode or degraded imports into their exact receipt. A bounded **Recent decisions** view shows current evidence-scoped projections beside append-only transitions across workspaces. The browser preserves server rank and revalidates the current evidence identity before allowing the routed review. Model text and free-form run content cannot create lineage, authority, or approval.

Multiple imported workspaces remain selectable and isolated in the browser. **Refresh local state** reloads runs, receipt health, claim history, proof metadata, and decisions. Halba does not run a background filesystem watcher: bounded explicit import plus refresh is fast, auditable, and sufficient until measured operator latency proves otherwise.

Schema-v3 local state appends every successful import and decision transition to a canonical SHA-256 hash chain in the same transaction. `npm run trust:pack -- export ...` creates a private, independently verifiable workspace pack containing its histories and exact proof bytes plus the complete ledger witness; `verify` checks it without SQLite. These are unsigned local integrity receipts, not identity or authorship signatures. See [`docs/local-state.md`](docs/local-state.md#portable-tru

[README truncated for size]

## Detected evidence (automated analysis)

Indexed codebase: 84 recognized source files, 674 KB.
- CSS (language) — detected in the code
- HTML (language) — detected in the code
- JavaScript (language) — detected in the code
- React (technology) — detected in the code
- TypeScript (language) — detected in the code
- Docker (technology) — claimed on Devpost, not found in the code
- Node.js (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (120 of 183)

```
.dockerignore
.env.example
.gitattributes
.github/workflows/pages.yml
.gitignore
artifacts/demo/narration.m4a
artifacts/demo/README.md
artifacts/evals/latest.json
artifacts/evals/latest.md
artifacts/evals/trust-operations-baseline.json
artifacts/evals/trust-operations-baseline.md
artifacts/evals/trust-operations-v1-baseline.json
artifacts/evals/trust-operations-v1-baseline.md
artifacts/evals/workspace-latest.json
artifacts/evals/workspace-latest.md
artifacts/public-binary-assets.json
CONTRIBUTING.md
data/demo/bundle.json
data/demo/diffs/stale-review-clock.patch
data/demo/receipts/check.txt
data/demo/receipts/model-run.json
data/demo/receipts/privacy-audit.md
data/demo/recorded/gpt-5.6-sol-proof.json
data/demo/sources/agent-report.md
data/demo/sources/change-summary.md
data/demo/workspace.json
data/import-fixtures/ci-receipt.json
data/import-fixtures/ci-run.json
data/import-fixtures/codex-proof/bundle.json
data/import-fixtures/codex-proof/proof-output.json
data/import-fixtures/codex-proof/receipts/check.txt
data/import-fixtures/codex-proof/sources/contract.md
data/import-fixtures/codex-proof/sources/report.md
data/import-fixtures/codex-run.json
data/import-fixtures/codex-session-clean.jsonl
data/import-fixtures/codex-session-incomplete.jsonl
data/import-fixtures/codex-session-mixed.jsonl
data/import-fixtures/codex-session.jsonl
data/import-fixtures/evidence-policy-v2.json
data/import-fixtures/release-artifact.txt
data/import-fixtures/release-manifest.json
data/import-fixtures/release-run.json
data/import-fixtures/second-run.json
data/sample-feed.json
data/sample-source/sample/build.md
data/sample-source/sample/research.md
Dockerfile
docs/agent-workspace-plan.md
docs/architecture.md
docs/build-week/plan.md
docs/contracts.md
docs/deployment.md
docs/evals.md
docs/feed-contract.md
docs/importer-template.md
docs/local-state.md
docs/openai.md
docs/privacy.md
docs/proof-bundle.md
docs/public-package-manifest.md
docs/run-import.md
evals/corpus.json
evals/workspace-corpus.json
LICENSE
package.json
public/app.js
public/index.html
public/shared/review-contract.js
public/shared/trust-contract.js
public/shared/workspace-contract.js
public/styles.css
public/trust-inbox.js
public/workspace-import.js
public/workspace-state.js
README.md
scripts/audit-public.mjs
scripts/browser-public-demo.mjs
scripts/browser-trust-inbox.mjs
scripts/browser-workspace-scale.mjs
scripts/build-pages.mjs
scripts/check-accessibility.mjs
scripts/check-adapter-conformance.mjs
scripts/check-ci-manifest.mjs
scripts/check-claim-history.mjs
scripts/check-codex-import.mjs
scripts/check-evidence-policy-v2.mjs
scripts/check-feed-sort.mjs
scripts/check-human-trust-eval.mjs
scripts/check-local-store.mjs
scripts/check-openai-adapter.mjs
scripts/check-pages.mjs
scripts/check-proof-bundle.mjs
scripts/check-proof-engine.mjs
scripts/check-public-manifest.mjs
scripts/check-release-manifest.mjs
scripts/check-review-export.mjs
scripts/check-run-importers.mjs
scripts/check-sample-feed.mjs
scripts/check-source-preview-copy.mjs
scripts/check-stale.mjs
scripts/check-trust-inbox.mjs
scripts/check-trust-operations.mjs
scripts/check-trust-pack-cli.mjs
scripts/check-trust-pack.mjs
scripts/check-trust-v1-baseline.mjs
scripts/check-view-state.mjs
scripts/check-weekly-review.mjs
scripts/check-workspace-import.mjs
scripts/check-workspace-scale.mjs
scripts/check-workspace.mjs
scripts/check.mjs
scripts/eval-trust-operations.mjs
scripts/eval-workspace.mjs
scripts/eval.mjs
scripts/feed-validation.mjs
scripts/human-trust-inbox-eval.mjs
scripts/import-codex-run.mjs
scripts/import-run.mjs
scripts/public-manifest.mjs
scripts/public-package-dry-run.mjs
[63 more files omitted for size]
```

### Dependencies

- submission/video/package.json: @remotion/captions@4.0.489, @remotion/cli@4.0.489, @remotion/eslint-config-flat@4.0.489, @remotion/media@4.0.489, @types/react@19.2.7, @types/web@0.0.166, eslint@9.19.0, prettier@3.8.1, react@19.2.3, react-dom@19.2.3, remotion@4.0.489, typescript@5.9.3

### Recent commits (newest first)

- Ship Trust Operations Build Week candidate
- Improve evidence control and review workflows
- docs: reconcile final Build Week evidence
- docs: synchronize final Devpost submission
- fix: label workspace screenshots correctly
- feat: turn Halba into an agent workspace
- feat: export portable proof reviews
- docs: record Build Week submission
- docs: record published submission film
- release: align submission with live Build Week rules
- fix: deploy Devpost gallery thumbnail
- docs: harden Devpost submission transport
- docs: record deployed visual release proof
- feat: sharpen Proof Mode visual story
- docs: map judging criteria to proof
- ci: upgrade Pages actions runtime
- docs: record deployed release evidence
- feat: harden proof evidence and public demo
- feat: ship Build Week Proof Mode
- chore: establish sanitized public baseline

## Key source files (fetched from GitHub, selected and truncated for size)

### SECURITY.md

```markdown
# Security policy

## Supported version

Security fixes apply to the current `main` branch until tagged releases exist.

## Reporting a vulnerability

Do not open a public issue for a vulnerability that could expose local files, credentials, imported evidence, or source paths. Use the repository owner's private security-reporting channel when one is published.

Include:

- affected version or commit;
- reproduction steps using public-safe sample data;
- expected and actual behavior;
- impact and any known workaround.

Never include real credentials or private evidence in a report.

## Security boundary

Halba is local-first, but local does not mean trusted by default:

- source paths are untrusted and must remain inside the configured source root;
- imported content and model output are untrusted data;
- model citations must pass deterministic path and line validation;
- OpenAI credentials stay server-side and are never returned by an API;
- public packages are generated from an allowlist, not from the entire working tree.

```

### CONTRIBUTING.md

```markdown
# Contributing to Halba

Halba accepts changes that make agent work easier to follow and harder to misrepresent. The useful contribution areas are local agent-run adapters, typed event normalization, proof adjudication, exact-source review, human gates, evals, and the workspace interface.

Halba deliberately does not aim to become a general human chat, project-management, or realtime-collaboration product. A channel is a durable context for agent work; proof state, not message volume, decides what needs attention.

## Where to contribute

- **Agent adapters:** map a public-safe local run format into Halba's bounded workspace and proof contracts. [`src/importers/codex-proof.js`](src/importers/codex-proof.js) is the smallest working example.
- **Proof guards:** add deterministic checks for facts that source bytes or machine receipts can settle better than a model.
- **Evals:** contribute compact fixtures for unsupported, stale, contradictory, uncertain, or degraded agent claims.
- **Interface:** improve workspace, thread, evidence, loading, empty, error, and mobile states without adding social noise.
- **Documentation:** make local setup, importer boundaries, and failure recovery easier to follow.

Start with [`docs/agent-workspace-plan.md`](docs/agent-workspace-plan.md), [`docs/architecture.md`](docs/architecture.md), and [`docs/proof-bundle.md`](docs/proof-bundle.md). Keep the change to one reviewable vertical slice.

## Before opening a change

1. Keep fixtures synthetic or unquestionably public-safe.
2. Add deterministic coverage for new proof behavior.
3. Add eval cases when a change affects claim verdicts or citations.
4. Reuse the dependency-free Node, browser, JSON, and local-file patterns before proposing infrastructure.
5. Run the focused checks while working, then the release gate:

```bash
npm run release:check
```

For visible changes, also inspect the rendered desktop and mobile application. A clean command result is not evidence that the interface works.

## Pull request evidence

Describe the user-visible outcome, files or contracts changed, commands run, and anything not exercised. UI changes should include current desktop and mobile screenshots. Adapter changes should include one synthetic or unquestionably public-safe fixture plus a focused failing/passing check.

## Data and security

Never commit credentials, private project files, personal absolute paths, or unredacted agent transcripts. Import adapters should be read-only and opt-in. Report security issues using the process in [`SECURITY.md`](SECURITY.md).

```

### Dockerfile

```
FROM node:22-alpine

WORKDIR /app
COPY . .

ENV NODE_ENV=production
ENV PORT=4177
EXPOSE 4177

HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
  CMD node -e "fetch('http://127.0.0.1:4177/api/proof/bundle').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"

CMD ["node", "src/server.js"]

```

### package.json

```
{
  "name": "halba",
  "version": "0.3.1",
  "private": true,
  "description": "Local-first evidence control plane for AI-assisted work.",
  "type": "module",
  "scripts": {
    "start": "node src/server.js",
    "check": "node scripts/check.mjs && node scripts/check-stale.mjs && node scripts/check-trust-v1-baseline.mjs && node scripts/check-claim-history.mjs && node scripts/check-weekly-review.mjs && node scripts/check-evidence-policy-v2.mjs && node scripts/check-trust-operations.mjs && node scripts/check-trust-inbox.mjs && node scripts/check-human-trust-eval.mjs && node --disable-warning=ExperimentalWarning scripts/check-workspace-scale.mjs && node scripts/check-accessibility.mjs && node scripts/check-feed-sort.mjs && node scripts/check-review-export.mjs && node scripts/check-source-preview-copy.mjs && node scripts/check-sample-feed.mjs && node scripts/check-view-state.mjs && node scripts/check-proof-bundle.mjs && node scripts/check-proof-engine.mjs && node scripts/check-openai-adapter.mjs && node scripts/check-workspace.mjs && node scripts/check-workspace-import.mjs && node --disable-warning=ExperimentalWarning scripts/check-local-store.mjs && node --disable-warning=ExperimentalWarning scripts/check-run-importers.mjs && node scripts/check-ci-manifest.mjs && node scripts/check-release-manifest.mjs && node --disable-warning=ExperimentalWarning scripts/check-adapter-conformance.mjs && node scripts/check-trust-pack.mjs && node --disable-warning=ExperimentalWarning scripts/check-trust-pack-cli.mjs && node scripts/check-codex-import.mjs && node scripts/check-pages.mjs && node scripts/check-public-manifest.mjs && node scripts/audit-public.mjs",
    "check:data": "node scripts/check.mjs",
    "check:sort": "node scripts/check-feed-sort.mjs",
    "check:stale": "node scripts/check-stale.mjs",
    "check:claim-history": "node scripts/check-claim-history.mjs",
    "check:weekly-review": "node scripts/check-weekly-review.mjs",
    "check:trust-operations": "node scripts/check-trust-operations.mjs",
    "check:evidence-policy-v2": "node scripts/check-evidence-policy-v2.mjs",
    "check:trust-inbox": "node scripts/check-trust-inbox.mjs",
    "check:human-trust-eval": "node scripts/check-human-trust-eval.mjs",
    "check:trust-v1-baseline": "node scripts/check-trust-v1-baseline.mjs",
    "check:accessibility": "node scripts/check-accessibility.mjs",
    "check:workspace-scale": "node --disable-warning=ExperimentalWarning scripts/check-workspace-scale.mjs",
    "check:review": "node scripts/check-review-export.mjs",
    "check:source-preview": "node scripts/check-source-preview-copy.mjs",
    "check:sample-feed": "node scripts/check-sample-feed.mjs",
    "check:public-manifest": "node scripts/check-public-manifest.mjs",
    "check:proof-bundle": "node scripts/check-proof-bundle.mjs",
    "check:proof-engine": "node scripts/check-proof-engine.mjs",
    "check:openai-adapter": "node scripts/check-openai-adapter.mjs",
    "check:pages": "node scripts/check-pages.mjs",
    "check:workspace": "node scripts/check-workspace.mjs",
    "check:workspace-import": "node scripts/check-workspace-import.mjs",
    "check:store": "node --disable-warning=ExperimentalWarning scripts/check-local-store.mjs",
    "check:run-importers": "node --disable-warning=ExperimentalWarning scripts/check-run-importers.mjs",
    "check:ci-manifest": "node scripts/check-ci-manifest.mjs",
    "check:release-manifest": "node scripts/check-release-manifest.mjs",
    "check:adapter-conformance": "node --disable-warning=ExperimentalWarning scripts/check-adapter-conformance.mjs",
    "check:trust-pack": "node scripts/check-trust-pack.mjs && node --disable-warning=ExperimentalWarning scripts/check-trust-pack-cli.mjs",
    "check:codex-import": "node scripts/check-codex-import.mjs",
    "audit:public": "node scripts/audit-public.mjs",
    "eval": "node scripts/eval.mjs && node scripts/eval-workspace.mjs && node scripts/eval-trust-operations.mjs",
    "eval:goal": "node scripts/eval.mjs && node scripts/eval-workspace.mjs && node scripts/eval-trust-operations.mjs --require-human",
    "eval:human-trust": "node scripts/human-trust-inbox-eval.mjs",
    "eval:report": "node scripts/eval.mjs --write && node scripts/eval-workspace.mjs --write && node scripts/eval-trust-operations.mjs --write",
    "benchmark:trust": "node scripts/eval-trust-operations.mjs --write",
    "browser:trust-inbox": "node scripts/browser-trust-inbox.mjs",
    "browser:workspace-scale": "node --disable-warning=ExperimentalWarning scripts/browser-workspace-scale.mjs",
    "build:pages": "node scripts/build-pages.mjs",
    "check:view-state": "node scripts/check-view-state.mjs",
    "package:dry-run": "node scripts/public-package-dry-run.mjs",
    "release:check": "node scripts/release-check.mjs",
    "release:goal": "node scripts/release-check.mjs --require-human",
    "release:browser": "node --disable-warning=ExperimentalWarning scripts/release-browser-check.mjs",
    "state": "node --disable-warning=ExperimentalWarning scripts/state.mjs",
    "state:seed-trust": "node --disable-warning=ExperimentalWarning scripts/seed-trust-benchmark.mjs",
    "import:run": "node --disable-warning=ExperimentalWarning scripts/import-run.mjs",
    "review:weekly": "node --disable-warning=ExperimentalWarning scripts/weekly-review.mjs",
    "trust:pack": "node --disable-warning=ExperimentalWarning scripts/trust-pack.mjs",
    "import:codex-demo": "node scripts/import-codex-run.mjs",
    "smoke": "node scripts/smoke-sample.mjs && node scripts/smoke-proof.mjs && node --disable-warning=ExperimentalWarning scripts/smoke-state.mjs",
    "smoke:proof": "node scripts/smoke-proof.mjs",
    "smoke:state": "node --disable-warning=ExperimentalWarning scripts/smoke-state.mjs"
  },
  "engines": {
    "node": ">=22.5"
  }
}

```

### submission/video/package.json

```
{
  "name": "halba-build-week-video",
  "version": "1.0.0",
  "description": "Reproducible Halba Build Week demo film.",
  "repository": "https://github.com/jlekerli-source/halba",
  "license": "Apache-2.0",
  "private": true,
  "dependencies": {
    "@remotion/cli": "4.0.489",
    "@remotion/captions": "4.0.489",
    "@remotion/media": "4.0.489",
    "react": "19.2.3",
    "react-dom": "19.2.3",
    "remotion": "4.0.489"
  },
  "devDependencies": {
    "@remotion/eslint-config-flat": "4.0.489",
    "@types/react": "19.2.7",
    "@types/web": "0.0.166",
    "eslint": "9.19.0",
    "prettier": "3.8.1",
    "typescript": "5.9.3"
  },
  "scripts": {
    "dev": "remotion studio",
    "build": "remotion bundle",
    "render": "remotion render src/index.ts HalbaBuildWeek ../../artifacts/demo/halba-demo.mp4 --public-dir ../../artifacts --codec h264 --crf 18 --concurrency=1 --timeout=120000 --browser-executable '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'",
    "still": "remotion still src/index.ts HalbaBuildWeek ../../artifacts/demo/halba-demo-still.png --public-dir ../../artifacts --frame 825 --browser-executable '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'",
    "thumbnail": "remotion still src/index.ts HalbaThumbnail ../../artifacts/demo/devpost-thumbnail.png --public-dir ../../artifacts --frame 0 --browser-executable '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'",
    "upgrade": "remotion upgrade",
    "lint": "eslint src && tsc"
  },
  "sideEffects": [
    "*.css"
  ]
}

```

### src/server.js

```javascript
import http from "node:http";
import { readFile } from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { mergeAgentUpdates } from "./domain/agent-updates.js";
import { analyzeClaimHistory } from "./domain/claim-history.js";
import { buildWeeklyReview, weeklyReviewMarkdown } from "./domain/weekly-review.js";
import { buildTrustOperations } from "./domain/trust-operations.js";
import { formatImportRunDelta, formatImportRunDeltaDetails, importRunDelta } from "./domain/feed.js";
import { loadWorkspace } from "./domain/workspace.js";
import { loadProofBundle, publicBundleSummary } from "./proof/bundle.js";
import { runProof } from "./proof/run.js";
import { loadStoredSource, storedAdjudication, storedBundleSummary } from "./proof/stored.js";

const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const publicDir = path.join(root, "public");
const domainDir = path.join(root, "src", "domain");
const feedPath = path.resolve(root, process.env.HALBA_FEED_FILE || "data/sample-feed.json");
const sourceRoot = path.resolve(root, process.env.HALBA_SOURCE_ROOT || "data/sample-source");
const agentUpdatesPath = process.env.HALBA_AGENT_UPDATES_FILE
  ? path.resolve(root, process.env.HALBA_AGENT_UPDATES_FILE)
  : null;
const importRunsPath = process.env.HALBA_IMPORT_RUNS_FILE
  ? path.resolve(root, process.env.HALBA_IMPORT_RUNS_FILE)
  : null;
const legacyFeedEnabled = process.env.HALBA_ENABLE_LEGACY_FEED === "1";
const port = Number(process.env.PORT || 4177);
const host = String(process.env.HALBA_HOST || "127.0.0.1").trim();
const remoteAccessEnabled = process.env.HALBA_ALLOW_REMOTE === "1";
const loopbackHosts = new Set(["127.0.0.1", "::1", "localhost"]);
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error("PORT must be an integer between 1 and 65535");
if (!host) throw new Error("HALBA_HOST must not be empty");
if (!loopbackHosts.has(host) && !remoteAccessEnabled) {
  throw new Error("Refusing non-loopback HALBA_HOST without HALBA_ALLOW_REMOTE=1");
}
const allowedOrigins = new Set([
  `http://127.0.0.1:${port}`,
  `http://localhost:${port}`,
  `http://[::1]:${port}`,
  ...String(process.env.HALBA_ALLOWED_ORIGINS || "").split(",").map((value) => value.trim()).filter(Boolean)
]);
const sourceLimit = 14000;
const requestBodyLimit = 4096;
const decisionBodyLimit = 64 * 1024;
const stateFile = String(process.env.HALBA_STATE_FILE || "").trim();
const localStore = stateFile
  ? await import("./storage/local-store.js").then(({ openLocalStore }) => openLocalStore(stateFile))
  : null;

const types = {
  ".css": "text/css; charset=utf-8",
  ".html": "text/html; charset=utf-8",
  ".js": "text/javascript; charset=utf-8",
  ".json": "application/json; charset=utf-8",
  ".svg": "image/svg+xml; charset=utf-8"
};

function slug(value) {
  return String(value || "")
    .toLowerCase()
    .replace(/[^a-z0-9]+/g, "-")
    .replace(/^-|-$/g, "");
}

function pathParts(rawPath) {
  const [filePath, anchor] = String(rawPath || "").split("#");
  return { filePath, anchor };
}

function isInside(base, target) {
  const relative = path.relative(base, target);
  return relative && !relative.startsWith("..") && !path.isAbsolute(relative);
}

function sourceFile(rawPath) {
  const { filePath } = pathParts(rawPath);
  const parts = String(filePath || "").split(/[\\/]+/);
  const hasScheme = /^[a-z][a-z0-9+.-]*:/i.test(filePath || "");
  if (
    !filePath
      || path.isAbsolute(filePath)
      || path.win32.isAbsolute(filePath)
      || hasScheme
      || parts.includes("..")
  ) return null;
  const target = path.resolve(sourceRoot, filePath);
  if (!isInside(sourceRoot, target)) return null;
  return target;
}

function markdownSection(text, anchor) {
  if (!anchor) return null;
  const headings = [...text.matchAll(/^(#{1,6})\s+(.+)$/gm)];
  const index = headings.findIndex((match) => slug(match[2]) === anchor);
  if (index === -1) return null;

  const current = headings[index];
  const currentLevel = current[1].length;
  const next = headings.slice(index + 1).find((match) => match[1].length <= currentLevel);
  return text.slice(current.index, next?.index ?? text.length).trim();
}

function lineCount(text) {
  return text ? String(text).split(/\r\n|\r|\n/).length : 0;
}

async function sourceResponse(searchParams, limit = sourceLimit) {
  const relativePath = searchParams.get("path") || "";
  const { anchor } = pathParts(relativePath);
  const file = sourceFile(relativePath);
  if (!file) return { status: 403, body: { error: "forbidden source path" } };

  try {
    const text = await readFile(file, "utf8");
    const preview = markdownSection(text, anchor) || text;
    const bodyText = preview.length > limit ? preview.slice(0, limit) : preview;
    return {
      status: 200,
      body: {
        path: relativePath,
        anchor: anchor || null,
        text: bodyText,
        lineCount: lineCount(bodyText),
        truncated: preview.length > limit
      }
    };
  } catch {
    return { status: 404, body: { error: "source not found", path: relativePath } };
  }
}

async function importDeltaResponse() {
  if (!importRunsPath) {
    const delta = importRunDelta({ runs: [] });
    return { status: 200, body: { delta, text: formatImportRunDelta(delta), detailText: formatImportRunDeltaDetails(delta) } };
  }
  try {
    const text = await readFile(importRunsPath, "utf8");
    const history = JSON.parse(text);
    const delta = importRunDelta(history);
    return { status: 200, body: { delta, text: formatImportRunDelta(delta), detailText: formatImportRunDeltaDetails(delta) } };
  } catch (error) {
    if (error?.code === "ENOENT") {
      const delta = importRunDelta({ runs: [] });
      return { status: 200, body: { delta, text: formatImportRunDelta(delta), detailText: formatImportRunDeltaDetails(delta) } };
    }
    return { status: 500, body: { error: "import delta unavailable" } };
  }
}

async function feedResponse() {
  try 
[truncated — 25026 more characters]
```

### submission/video/src/index.ts

```typescript
import { registerRoot } from "remotion";
import { RemotionRoot } from "./Root";

registerRoot(RemotionRoot);

```

### public/workspace-state.js

```javascript
export { decisionClosesGate } from "./shared/review-contract.js";

import { decisionClosesGate } from "./shared/review-contract.js";

export function shouldAdvanceReviewSelection(status) {
  return decisionClosesGate({ status });
}

```

### public/workspace-import.js

```javascript
import { validateWorkspace } from "./shared/workspace-contract.js";

export function validateImportedWorkspace(data) {
  try {
    return validateWorkspace(data);
  } catch (error) {
    const message = String(error?.message || "workspace is invalid").replace(/^invalid workspace:\s*/, "");
    throw new Error(`Workspace rejected: ${message}`);
  }
}

```

### public/index.html

```html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="theme-color" content="#f7f5ee">
    <meta name="description" content="Halba is a local-first trust operations control plane where agent claims meet exact evidence, deterministic guards, and accountable human decisions.">
    <title>Halba — Trust Operations</title>
    <link rel="icon" href="halba-icon.svg" type="image/svg+xml">
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <a class="skip-link" href="#main-content">Skip to main content</a>
    <header class="topbar">
      <a class="brand" href="./" aria-label="Halba home">
        <img src="halba-icon.svg" alt="" aria-hidden="true">
        <span>
          <strong>Halba</strong>
          <small>Trust operations</small>
        </span>
      </a>

      <ol class="process" aria-label="Halba authority loop">
        <li data-process-step="workspace"><span>1</span>Claim</li>
        <li data-process-step="thread"><span>2</span>Evidence + guard</li>
        <li data-process-step="proof"><span>3</span>Human decision</li>
      </ol>

      <div class="topbar-actions">
        <span id="execution-badge" class="execution-badge">Public demo</span>
        <button class="button button-secondary" type="button" data-run-mode="live">
          <svg class="button-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12h3l2.2-6 3.4 12 2.2-6H19"/></svg>
          Run live GPT-5.6
        </button>
        <button class="button button-primary" type="button" data-run-mode="recorded">
          <svg class="button-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="m9 7 8 5-8 5Z"/></svg>
          Run recorded demo
        </button>
      </div>
    </header>

    <div id="status-region" class="status-region" aria-live="polite"></div>

    <div id="app" class="app" aria-busy="true">
      <section class="boot-state" aria-label="Loading Halba">
        <span class="boot-mark" aria-hidden="true"></span>
        <p>Indexing the public proof bundle…</p>
      </section>
    </div>

    <input id="workspace-file" type="file" accept="application/json,.json" hidden>

    <nav id="mobile-tabs" class="mobile-tabs" aria-label="Proof Mode views" role="tablist" hidden>
      <button id="proof-tab-summary" type="button" role="tab" data-mobile-view="summary" aria-controls="proof-panel-summary" aria-selected="true">Summary</button>
      <button id="proof-tab-claims" type="button" role="tab" data-mobile-view="claims" aria-controls="proof-panel-claims" aria-selected="false" tabindex="-1">Claims</button>
      <button id="proof-tab-source" type="button" role="tab" data-mobile-view="source" aria-controls="proof-panel-source" aria-selected="false" tabindex="-1">Source</button>
    </nav>

    <script src="app.js" type="module"></script>
  </body>
</html>

```

[70 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]