Skip to content

About

Local-first cross-client HTTP conformance lab and sanitized evidence for Technocore issue 95

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Technocore HTTP Conformance Lab

A standalone, local-first v0.1 lab for investigating flop-labs/technocore-chat#95 HTTP-client transport differences. It compares malformed JSON POST behavior across Python http.client, curl, Node global fetch/Undici, and Node core http/https.

See FINDINGS.md for the validated Windows/Linux results, the bounded deployed observation, limitations, and correction history.

Three deliberately separate profiles

1. Synthetic loopback fixture — default

local uses this repository's small raw HTTP/1.1 fixture, bound only to 127.0.0.1 on an ephemeral port. It tests health/read baselines and malformed JSON using explicit Content-Length and chunked framing. Fixture captures preserve request headers as ordered pairs and tests assert each adapter's actual POST framing.

PYTHONPATH=src python -m technocore_conformance
PYTHONPATH=src python -m technocore_conformance local --output report.json

This is fast protocol isolation; it is not the real Technocore application.

2. Real upstream application, still local

upstream-local requires an existing local flop-labs/technocore-chat checkout. It never clones or downloads a repository. The command validates pyproject.toml project name technocore-chat and src/app.py, then starts the real app:app under Uvicorn on ephemeral IPv4 loopback using h11 and disabled proxy headers.

PYTHONPATH=src python -m technocore_conformance upstream-local \
  --repo /path/to/technocore-chat \
  --output upstream-report.json

It prefers the checkout's .venv Uvicorn. Otherwise it invokes installed uv with --offline --frozen; missing cached dependencies fail closed rather than accessing the network. CHAT_ROOT and any fallback uv environment are placed in a private temporary directory.

The profile waits boundedly for exact /healthz, then exercises all adapters against:

  • /healthz
  • A unique, harmless absent-room GET
  • Malformed POST /r/transport-probe with explicit length
  • The same malformed POST with chunked framing

Before probing, after every observation, and immediately before teardown it verifies that /r/transport-probe?format=json has zero messages and that the private store inventory/hashes have not changed. It then terminates the server process tree and deletes the temporary store.

3. Deployed diagnostic — explicit dangerous opt-in

WARNING: live sends public network traffic. It is never run by tests or CI. It accepts only exact origin https://technocore.chat, exact profile issue-95-fixed-malformed-post-v1, and exact acknowledgement I_UNDERSTAND_THIS_SENDS_LIVE_TRAFFIC.

PYTHONPATH=src python -m technocore_conformance live \
  --target https://technocore.chat \
  --profile issue-95-fixed-malformed-post-v1 \
  --acknowledge I_UNDERSTAND_THIS_SENDS_LIVE_TRAFFIC

For a focused recheck, --adapter may select one or more entries from the fixed built-in allowlist. It does not accept arbitrary executables or client code:

PYTHONPATH=src python -m technocore_conformance live \
  --target https://technocore.chat \
  --profile issue-95-fixed-malformed-post-v1 \
  --acknowledge I_UNDERSTAND_THIS_SENDS_LIVE_TRAFFIC \
  --adapter node-fetch-undici

The fixed profile makes at most one natural string-body malformed POST per available adapter to /r/transport-probe: at most four attempts, sequentially, at least ten seconds apart, no retries, redirects, ambient proxy, custom path/body/headers/cookies/credentials, signing, or write SDK. Python, curl, and Node core emit explicit length; Fetch/Undici chooses its natural string-body framing because JavaScript forbids consistently setting restricted Content-Length. The run records intended framing, reports missing adapters as skips, and stops immediately after HTTP 429. Per-child deadlines plus the fixed request count and spacing bound the run.

Safety model

Children receive a minimal environment with inherited proxy and credential-like variables removed. Commands use argument arrays and shell=False. Child process trees have hard deadlines and bounded concurrent stdout/stderr draining. Reports are recursively sanitized before persistence and again during aggregation, including credential headers, cookies, URL userinfo/query/fragment, Cloudflare/request/trace IDs, errors, and canaries.

There is no signing or write SDK. No command infers live mode from environment.

Commands and exit codes

PYTHONPATH=src python -m technocore_conformance doctor --json
PYTHONPATH=src python -m technocore_conformance validate-report report.json
PYTHONPATH=src python -m technocore_conformance render report.json --output report.md

Exit codes: 0 success/conformant, 1 completed divergence, 2 usage or live/upstream policy rejection, 3 harness/I/O/report failure, 4 no selected adapter available, and 130 conventional interruption.

Reports

JSON report and observation identifiers are versioned; checked-in schemas live in schemas/. Runtime validation has no external dependency and strictly checks required/unknown keys, types, enums, nonnegative minima, ISO timestamps, UUIDs, every observation, and exact summary reconciliation. Response headers are represented as ordered [name, value] pairs so duplicate fields remain distinguishable when exposed by a client. Markdown is generated only from a validated, sanitized JSON model.

Failure boundaries are conservative: client_runtime, dns, tcp, tls, proxy, http_framing, application, harness, or unknown. Boundary and pass/fail status are independent.

Development

Python 3.12+ is required. Curl and Node are optional and produce skips when absent.

PYTHONPATH=src python -m py_compile src/technocore_conformance/*.py tests/*.py
uvx ruff check .
uvx ruff format --check .
PYTHONPATH=src python -m unittest discover -s tests -v

To include the real local-server integration test without downloads:

TECHNOCORE_UPSTREAM_REPO=/path/to/technocore-chat \
  PYTHONPATH=src python -m unittest discover -s tests -v

About

Local-first cross-client HTTP conformance lab and sanitized evidence for Technocore issue 95

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages