Skip to content

fix(policy): v1.2.19 read-only commands stay out of state-change classes [t_6f335dd6] - #33

Merged
maximalang merged 2 commits into
codex/company-osfrom
fix/fp-read-classifier-v1219
Sep 13, 2026
Merged

maximalang merged 2 commits into
codex/company-osfrom
fix/fp-read-classifier-v1219

Conversation

@maximalang

Copy link
Copy Markdown
Owner

v1.2.19 — read-only commands stay out of state-change classes

Task: t_6f335dd6 (fleet-ops). Incident 13.09.2026: the lexical classifier routed four families of pure-read terminal commands into fail-closed lanes; 40+ false denies burned worker runs.

Root causes fixed (src/fleet_policy/policy.py)

  1. git config query forms (--get*, --list, bare key without value), git worktree list, git merge-base now classify read_only. MUTATOR's merge no longer matches merge-base (also in the release-rule regex and repository_change check). A git config write (value argument / --unset) remains a state change.
  2. git -C <path> wrapper is tolerated on read verbs AND symmetrically on MUTATOR's git verbs, so git -C repo push cannot dodge the mutator scan into the read lane. Wrapper match is case-sensitive: -c (per-invocation config injection, e.g. core.pager) stays fail-closed.
  3. cat joins the stdout-only read utilities; redirect/tee/in-place forms are still caught by the write-marker scan.
  4. gh api --jq / -q (space and fused = forms) joins the read-safe option allowlist — it only projects the JSON response and cannot change the HTTP method or carry a payload. Exact-head probes (gh api repos/o/r/commits/HEAD --jq .sha) are reads again. Method writes, --hostname overrides, absolute URLs, and unknown options still fail closed; the v1.2.7 F-01 test case that pinned --jq as fail-closed is replaced by --permissive.

Deliberately NOT relaxed: bare VAR=value env prefixes in front of python -m pytest stay fail-closed — PATH/LD_PRELOAD rebind the executed binary.

Verification

  • python -m pytest -q → 582 passed, exit 0 (Windows, python 3.11.16), including 42 new contract tests in tests/test_v1219_read_classifier.py (4 incident families + adversarial variants) and the full pre-existing suite (v1.2.6/v1.2.7 read-lane regressions, F-01/F-02 gh-api smuggles, pristine manifest).
  • Version bump 1.2.17 → 1.2.19 across pyproject.toml, plugin.yaml (root + integrations), __init__.__version__, and the version-match test.

Notes

Base: codex/company-os @ 7538369. task_type: code

…asses [t_6f335dd6]

Incident 13.09.2026: lexical classifier routed four families of pure-read
terminal commands into fail-closed lanes (40+ false denies, runs burned).

- git config query forms / worktree list / merge-base => read_only;
  MUTATOR merge no longer matches merge-base; config writes stay state_change
- git -C wrapper tolerated symmetrically in READ_COMMAND and MUTATOR
  (case-sensitive; -c stays fail-closed); git -C repo push cannot reach
  the read lane
- cat joins stdout-only read utilities; redirect/tee still write-marked
- gh api --jq/-q (space + fused =) joins read-safe option allowlist;
  method writes, hostname overrides, absolute URLs, unknown options
  still fail closed (v1.2.7 F-01 --jq case replaced by --permissive)
- VAR=value env prefix before pytest deliberately stays fail-closed
- version bump 1.2.17 -> 1.2.19 (pyproject, 2x plugin.yaml, __init__,
  version-match test); CHANGELOG entry; 42 contract tests
@maximalang
maximalang merged commit f9f0a95 into codex/company-os Sep 13, 2026
1 check passed
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