Revision: 1 Last modified: 2026-12-04T19:00:00Z
inbound.py handles inbound intake (C7) and DB-vs-tracker reconcile for the Issues mirror (anchor
§11.4.300; operator decisions 2026-11-25).
Its two governing rules are both safety properties:
- The DB wins. A tracker edit is never silently applied over the workable-items database.
- Everything here is READ-ONLY toward both trackers and the DB.
Instead of writing, it emits proposal files at docs/issues_sync/inbound/<id>.md. Those proposals are
adopted only through the normal workable-item procedure — by a human, or by an independently reviewed
change. Nothing here calls workable-items. So a hostile or mistaken tracker edit cannot become a
tracker-side write to the database; the worst it can do is produce a document a reviewer must read.
An issue body is written by anyone with comment access on the upstream. Treating it as anything other than data is prompt injection with extra steps. So inbound text is:
- normalised;
- secret-scanned — a single hit withholds the whole text, it is not partially redacted;
- length-capped;
- placed only inside a code fence longer than any backtick run it contains, so the text cannot close the fence and escape into the surrounding document;
- never executed, never interpolated into a command, never followed as an instruction.
Withholding the entire text on a secret hit is the conservative choice on purpose: a partially redacted body invites the reader to trust the parts that were left.
python3.- Read access to the configured tracker(s) and to the workable-items DB.
- A writable
docs/issues_sync/inbound/directory for proposals. - Tokens read by variable name elsewhere; nothing here prints a credential.
# collect inbound proposals for review (writes proposal files only)
python3 -m issue_sync.pipeline pull
# compare the DB against the tracker state
python3 -m issue_sync.pipeline reconcileEach proposal lands at docs/issues_sync/inbound/<id>.md.
The module provides inbound intake and reconcile entry points used by pipeline.py and cli.py. It is a
library: it has no CLI of its own. Its contract-level behaviour is:
| Behaviour | Guarantee |
|---|---|
| Tracker reads | Read-only. |
| DB access | Read-only. |
| Output | Proposal files under docs/issues_sync/inbound/. |
| Adoption | Only via the normal workable-item procedure, externally. |
As a library, results surface through the caller (pipeline.py / cli.py), which use the three-valued
convention:
| Code | Meaning |
|---|---|
0 |
OK. |
1 |
Drift or conflict reported. |
2 |
Cannot determine — never a pass. |
- A tracker edit that conflicts with the DB. Reported, and its text is preserved as a proposal — never applied, never overwritten.
- A body containing a secret. The whole text is withheld from the proposal; the rest of the metadata still records that a proposal exists.
- A body containing backtick fences. Fenced with a longer run, so it cannot escape its block.
- A very long body. Length-capped rather than truncated into something that reads as complete.
- An item with no upstream issue. Nothing inbound to reconcile.
- A body instructing the reader to do something. It is data in a fence, never an instruction.
- An unreachable tracker during reconcile. Reported as cannot-determine (
2) for that leg, never as "in sync".
- Reads the configured trackers (read-only).
- For each relevant issue, extracts the body and metadata.
- Normalises the text, then scans for secrets; a hit withholds the entire body.
- Length-caps the text and wraps it in a code fence longer than any backtick run it holds.
- Writes a proposal file under
docs/issues_sync/inbound/<id>.md. - For reconcile, compares DB content hashes against the tracker and reports drift without writing.
Called by pipeline.py (pull, reconcile) and cli.py.
Related: payload.py (outbound allowlist and hashing — the mirror-image guard), redact.py (the
shared redaction primitives), store.py (read-only DB access).
See also docs/scripts/pipeline.md, docs/scripts/payload.md, docs/scripts/redact.md and
docs/scripts/store.md.
2026-12-04 — python3 -c "import ast;ast.parse(open('scripts/issue_sync/inbound.py').read())" → exit 0.
The module exposes no CLI entry point (it is a library), so there is no --help to run.