Skip to content

fix(approval): reduce classifier false prompts (T18) - #283

Merged
lg2m merged 27 commits into
docs/tool-layer-d10-auditfrom
fix/t18-classifier-false-prompts
Oct 13, 2026
Merged

lg2m merged 27 commits into
docs/tool-layer-d10-auditfrom
fix/t18-classifier-false-prompts

Conversation

@lg2m

@lg2m lg2m commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Spec: D10 T18. Linear: ENG-1031. Merged with #280, #281, and #285 onto main at e22537040bfb1605ee360881220cf5d8e8408ce3.

Closed launcher grammars and stream-only redirects reduce false prompts. Git worktree/branch reads are recognized; Git options expose destructive subcommands. Every git fetch and git -C stays held, and globs remain dynamic. Environment assignments use an explicit inert allowlist. Nested/env split commands retain bounded fail-closed analysis. Adversarial regressions cover the subsequent review repairs, including short terminal Git queries.

Integrated repair shipped with #285: final T18 commit 89a5582f introduced recursive env split substitution. Test-first c612655 / repair 4dbf121 use one original-source pass, last assignment wins, and a 16 KiB expansion cap. Overflow-floor test-first 99a07e4 / repair 4f0185f1 refuse expanded-over-limit commands under full and retain bounded prefix reasons.

Final integrated qualification is recorded in #285: 2243 workspace tests pass, 0 fail, 14 ignored (nested child counted once); 95 approval tests pass; fmt, all-target/all-feature Clippy with warnings denied, and workspace build pass. Independent second-agent review approves the integrated policy and repair. The checked-in d10_held shapes are authoritative; private replay remains advisory.

Final classifier 1 KiB median of 3: 167.050 µs ≤ 200 µs. Historical pre-change measurement was 164.0 µs; raw T18 and final integration receipts remain in the ledger. No tail or speedup claim on this shared host.

As-built classification design and ledger are current. No new RuleId, protocol field, descriptor, or schema change. ENG-1032 tracks existing process-group cancellation; ENG-1033 remains the follow-up register and unread-edit optimization issue. The three residual verdicts on 32a1972 were repaired in 89a5582.

Final source head c31d1a5c passed hosted CI 38426652160 (Linux, WebAssembly, Windows). ENG-1033 includes the final discarded-suffix over-refusal, deferred with independent approval under the recorded lead decision. Immediate docs reconciliation merged in #286 (ce768bbc2fb7a25b227fe3405734a316adf020a1); ENG-1031 is Done.

lg2m added 3 commits October 12, 2026 13:34
Adds rows to rule_examples_hold for each T18 relaxation, following the
plan as tightened in 3f36c94:
- closed-set launchers that take only their own options
- stream-only list redirects
- git -C
- git worktree list and git branch --list
- allowlisted plain git fetch

Adds the adversarial rows the plan names: foreign launcher options,
bare launchers, ionice/chrt/taskset/renice, every git fetch exclusion,
`git -c … fetch`, and globs that stay dynamic (`sed -n *`,
`grep -n x docs/*.md`).

Adds D10_HELD, 30 sanitized shapes from the held corpus. Each row
carries its verdict before and after T18, and no row may cross
Forbidden. rule_examples_hold now reports every mismatch at once.

Also pins two gaps found while writing the rows: `> 1` writes a file
named 1 but was judged as an fd dup (Allow), and `git -C dir push
--force` hid the subcommand (Prompt instead of Forbidden).

Slice: T18 (docs/plans/tool-layer.md § D10)
Refs: ENG-1031
…s; git -C

Removes the classifier false prompts that D10 found under `auto`. The
scope follows the plan as tightened in 3f36c94:

- Launchers: `timeout`, `time`, `nice`, `nohup`, and `stdbuf` are a
  closed set. When a launcher has exactly its own options (and, for
  `timeout`, a duration) plus an inner command, it is replaced by the
  inner command at the same level, which keeps its assignments and
  redirects. So `timeout 300 cargo test` is Allow, `nice rm -rf
  target` stays Prompt, and `timeout 5 sudo ls` stays Forbidden. A
  foreign option or a bare launcher is `unlisted`; the five are gone
  from the allow tables. `ionice`, `chrt`, `taskset`, and `renice` are
  not launchers. Peeling deeper than 8 levels is nested.
- Stream redirects: a `redirected_statement` whose redirects all write
  nothing (`2>&1`, `/dev/null`, `/dev/std*`) no longer nests a list or
  pipeline body. A descriptor duplication is recorded as `&N`, so
  `> 1`, which writes a file named 1, now prompts. Before this change
  it was allowed.
- `git -C <dir>…`: the hops are skipped before the subcommand is read,
  and their joined path is judged against the workspace. An escape is
  Prompt `path_outside_workspace`. `git -C x push --force` is now
  Forbidden (it was Prompt).
- `git worktree list` and `git branch --list [pattern]` are Allow.
- `git fetch` is Allow by allowlist only: `-q`, `-v`, `--all`,
  `--no-tags`, and plain remote or branch names. Every other form keeps
  `git_remote` (lead decision 2026-10-11).

Globs are unchanged.

Slice: T18 (docs/plans/tool-layer.md § D10)
Refs: ENG-1031
Amends tools.md § Shell Classification for the shipped classifier
behavior and records the T18 receipt in the tool-layer ledger.

Slice: T18 (docs/plans/tool-layer.md § D10)
Refs: ENG-1031
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T15:30:48.539776Z 89a5582 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Slice: T18 (docs/plans/tool-layer.md § D10)
Refs: ENG-1031
@lg2m

lg2m commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator Author

Requesting an independent review per docs/plans/workflow.md §4, because this slice touches approval. Use docs/plans/templates/review-checklist.md. The spec is docs/plans/tool-layer.md § D10, T18, at 3f36c94. The author will not self-approve.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8ea09bc71

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/rules.rs Resolved
lg2m added 2 commits October 12, 2026 22:16
- peel only bare launcher names; never allow a path-qualified program
- treat git -C into /tmp as an escape
- prompt on GIT_DIR/GIT_WORK_TREE/GIT_CONFIG_* for git
- allow git branch only for listing options (--list --no-list creates)
- keep plain git fetch held: configured refspecs may name local branches

Regression rows for each in rule_examples_hold and D10_HELD. ENG-1031.
…fix/t18-classifier-false-prompts

# Conflicts:
#	docs/plans/progress/tool-layer.md

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90dd9a4eac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/rules.rs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de15082f7a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/design/tools.md Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
lg2m added 2 commits October 12, 2026 22:51
…depth; float timeouts

- a contained-looking -C hop may be a workspace symlink and the gates
  have no root, so -C commands prompt (push --force still Forbidden)
- taskset/chrt peel past their positional so a Forbidden inner command
  is found; -p launches nothing
- the command after exactly eight launchers is judged, a ninth is not
  looked through
- timeout durations follow GNU float grammar (1e3, inf, .5m)

ENG-1031.
…fix/t18-classifier-false-prompts

# Conflicts:
#	docs/plans/progress/tool-layer.md

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e70c1bfab3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
lg2m added 2 commits October 12, 2026 23:12
…r-only -p, exact stream devices

- GIT_* on git and *_WRAPPER/*PAGER/*EDITOR/CARGO_*/RUSTC*/RUSTFLAGS on
  any program never allow (GIT_CONFIG_PARAMETERS core.fsmonitor ran code)
- skip every git global option before the subcommand, so
  git -C x -c k=v push --force is Forbidden
- taskset/chrt -p is read from the wrapper's own options only
- only exact /dev/std{in,out,err}, /dev/null, /dev/fd/<n> are streams

ENG-1031.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffb8d6dd4f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
lg2m added 2 commits October 12, 2026 23:28
…option operands; NUL-marked fd dups

- /usr/bin/timeout 5 sudo ls is Forbidden again (the tail is judged
  nested; the launcher is never allowed)
- git -C "$PWD" push --force is Forbidden (dynamic operand skipped)
- a file named &1 is no longer read as 2>&1
- timeout --foreground is not transparent

ENG-1031.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c3c2ab3f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
lg2m added 3 commits October 13, 2026 00:12
- skip --attr-source and any unknown git global before the subcommand
- taskset/chrt judge both candidates around the mask/priority
- env -S/--split-string is reparsed like sh -c (allowed on main)
- only fds 0-2 are harmless duplication targets; >&3 is a write

ENG-1031.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e35c5db48d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/rules.rs Resolved
lg2m added 2 commits October 13, 2026 00:36
…onstruction

- assignments: allowlist of output/test knobs; anything else prompts
  (RUSTDOC=, CC= were Allow on main)
- unknowable command start (depth cap, dynamic chrt/taskset, env -S):
  record unknown and judge every suffix, nested
- git branch filters consume their value; /dev/fd/0-2 are word-only

ENG-1031.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a3fb29e2d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
lg2m added 3 commits October 13, 2026 06:42
… carry, depth chain

- --sort/--format take a value but do not select list mode
- env -S removes quotes before splitting (su""do is sudo)
- env NAME=VALUE assignments travel with the peeled command
- past the depth cap, follow a clean launcher chain (no false Forbidden)

ENG-1031.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e4a71f8a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
lg2m added 3 commits October 13, 2026 07:09
…word; judge the depth-boundary command; bound suffix scans

- QQ_UPDATE_FIXTURES etc. prompt; only bench/soak knobs are inert
- git branch --format --list name creates name
- nice x8 sudo ls is Forbidden
- suffix enumeration capped at 64x16 (8k-word env -S was quadratic)

ENG-1031.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 692d06cdd5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
…branch filters list

- a deep --force is judged (16 starts, each whole)
- --contains=X etc. select list mode
- env -S trailing argv joins the split command

ENG-1031.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27a0c35518

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/rules.rs Resolved
Comment thread crates/qq-core/src/approval/rules.rs Resolved
…_UPDATE not inert; terminal git queries

ENG-1031.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32a1972de4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/rules.rs Resolved
…env -S expands literal assignments; git -h/-v terminal

ENG-1031.

lg2m commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

T20 integration coordination: independent review found a new P1 resource regression in 89a5582's repeated env -S replacement. A='${A}${A}' repeated 40 times plus env -S '${A} ls' recursively doubles inserted values (bounded eight-step reproduction:13,25,49,97,193,385,769,1537 bytes). Do not merge this head to main yet. I am preparing a bounded one-pass substitution repair and regression in isolated .worktrees/t20; will carry the repair through the stack before main. This is a new resource regression, outside the existing follow-up disposition.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89a5582f3c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
Comment thread crates/qq-core/src/approval/classify.rs Resolved
@lg2m lg2m changed the title fix(approval): T18 classifier false prompts (launchers, stream redirects, git -C, fetch) fix(approval): reduce classifier false prompts (T18) Oct 13, 2026
@lg2m
lg2m merged commit e225370 into main Oct 13, 2026
4 checks passed
@lg2m
lg2m deleted the fix/t18-classifier-false-prompts branch October 13, 2026 16:07
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