
Precise CLI invocation contracts, environment configuration, ten safety invariants, MOCK_AGENT test mode, and deployment constraints for Job Pilot v2. This document serves as the technical backbone for all build phases.
This TRD captures the non‑negotiable runtime contracts for Job Pilot v2. It defines how developers invoke the application from the command line, which environment variables are mandatory, how the mock agent test mode works, and the ten safety invariants that must hold across every build phase. By the end of this document you will have a clear checklist to validate each delivery phase.
Job Pilot v2 is started directly from the command line using Node 26. There is no package manager, no build step, and no external dependencies. The following contracts define exactly how developers launch the application in development, test, and production modes.
node index.jsMOCK_AGENT=1 node index.js| Variable | Required | Description |
|---|---|---|
| MOCK_AGENT | No | Set to 1 to enable simulated external service responses. Required for endpoint smoke tests. |
| OLLAMA_OVERRIDE | Yes | Mandatory override for Ollama environment configuration. Must be set to a valid local path. |
| CLAUDE_SUBSCRIPTION | Required in production | Authentication token for Claude Code CLI. Not needed when MOCK_AGENT=1. |
These ten invariants must hold true in every commit, every build phase, and every deployment. They are non‑negotiable and define the architectural boundaries that keep Job Pilot v2 stable and predictable.
The entire codebase relies only on Node 26 built‑ins. No package.json or node_modules folder exists.
All JSON file collections use atomic write operations (write-then-rename) to avoid corruption.
The HTTP server must start on port 7878. Any deviation is a critical error.
No network calls to external services except the Ollama override and BrowserClaw MCP on localhost.
Job Pilot v2 must not read, write, or lock files in the ~/JobPilot directory.
When MOCK_AGENT=1, all external integrations return canned responses; no real HTTP calls are made.
Every final application submission must be explicitly confirmed by a human via the UI; no automated sending.
The OLLAMA_OVERRIDE environment variable must be set; the app will refuse to start without it.
All event logs are appended in JSONL format. Each line is a complete, parseable JSON object with a timestamp.
The MCP endpoint at http://127.0.0.1:9000/mcp is firewalled to accept connections only from localhost.
The MOCK_AGENT=1 flag transforms Job Pilot v2 into a fully deterministic test harness. All external calls (Ollama, BrowserClaw, Claude) return pre‑defined responses, enabling developers to validate endpoint behaviour without live dependencies.
app/ directory.export MOCK_AGENT=1node index.jshttp://localhost:7878.MOCK_AGENT=1 node index.js| Scenario | Expected Behaviour |
|---|---|
| Syntax check | All modules load without syntax errors |
| GET /health | Returns { "status": "ok" } |
| POST /api/application | Returns mock submission result with status 200 |
| UI load | The dashboard loads without JavaScript errors |
These constraints govern how Job Pilot v2 is deployed, run, and tested. Violating any of the critical constraints will result in a non‑functional application. The development environment, CI (if any), and local machines must all satisfy these rules.
Hard‑coded port; cannot be changed via configuration.
No package.json, no node_modules. Only Node 26 built‑ins.
No outgoing requests except to localhost (BrowserClaw MCP) and Ollama override.
Must not touch files under ~/JobPilot. All data written inside JobPilot-v2 directory.
Claude Code CLI requires a valid subscription token stored as environment variable.
All build phases must pass smoke tests with mock agent enabled.

Vision, hard constraints, and non-negotiable requirements that shape every build decision in Job Pilot v2.
These constraints govern every architectural and implementation decision in Job Pilot v2.
Built exclusively with Node 26 built-ins. No external packages allowed in the dependency tree.
Deployed on port 7878, ensuring no conflict with the existing Job Pilot v1 at ~/JobPilot.
Runs entirely on localhost with BrowserClaw MCP at 127.0.0.1:9000/mcp. No cloud services.
All persistence uses JSON-file collections with atomic writes and JSONL event logs.
Mandatory safety rules from the TRD that cannot be violated under any build phase.
Required test mode for running endpoint smoke tests after completing each delivery phase.
Every specification, contract, and reference that feeds into the build.
docs/01-brd.mdBusiness Requirementsdocs/08-cloudhire-research.mdCloudHire ResearchThe sequential path every developer follows from context reading to deployment logging.
No comments yet. Be the first!