Repository navigation
Description
Problem
The negative search that the implement step runs (! git grep [options] <literal> [--] <path>..., #3263) takes one literal and no -e or -E. A group that removes several names cannot check them in one command. The plan of #2610 (openspec/changes/2610-devops-k8s-image-pins-resolves-with/tasks.md, group 3) has the Verification line ! git grep -n -E "ImagetoolsFake|inspect_command|imagetools_recording|imagetools_runs" -- src tests. The step refuses it with "the option -E is not allowed", so the step for #2610 would stop on that group. The stage gate cannot catch this, because that plan was staged before the gate read the step policy.
Proposed change
Decide one of two ways, and state it in docs/TESTING.md:
- Allow
-e <literal>more than once. Git treats several-epatterns as OR. Check each value as a literal with the same rules, so a pipe or a shell character stays refused. The step still passes only on exit 1. - Or keep one literal, and tell the planner to write one
! git grepline for each name, in separate tasks of the group.
A path that matches no file still passes (exit 1 with --). A group that deletes a directory needs that, and the stage job checks the verify paths at plan time.
Acceptance criteria
- A test shows that a search for two names runs and passes on exit 1, and fails on exit 0 with the matching lines.
- A test shows that a pipe, a shell character,
-E,-Pand every other option stay refused. - The plan of perf(k8s): use tag_digest HEAD for image pins #2610 is rewritten, so that its line uses the allowed form.
This item delivers these three criteria. Its pull request closes this item.
Moved to #3579: the test that reads every active tasks.md and fails on a Verification: line that the step refuses. That work is separate, because 15 refused commands stay in three active plans, and those plans need a rewrite first.
Proposed design
Problem statement
The implement step refuses a negative search that names more than one literal. The plan of #2610 has a ! git grep -E line that names four, so its group 3 stops. The change lets -e repeat, keeps every other rule of the fixed shape, requires -- before the paths when -e is used, and updates the documentation and the #2610 line.
Acceptance criteria
Requirement: Repeated -e literals
The negative search SHALL accept one or more -e options, each with a plain literal, as an alternative to the single positional literal, with -- before the paths.
Scenario: Two names that do not occur
- WHEN A Verification line holds
! git grep -n -e "ImagetoolsFake" -e "inspect_command" -- src tests, and neither name occurs in those paths. - THEN The step runs the command and the group passes on exit 1.
Requirement: A matched literal fails
A negative search MUST fail when git exits 0, and its reason MUST show the matching lines.
Scenario: One name occurs
- WHEN One of the
-eliterals occurs in a path of the search. - THEN The step fails the group, and the reason holds the lines that
git grepprinted.
Requirement: Refused options and characters
The negative search MUST refuse -E, -P, a pipe, a shell character and every option outside the allowed list, in the positional literal and in each -e value.
Scenario: A pipe in an -e value
- WHEN An
-evalue holds a pipe, or the line holds-Eor-P. - THEN The step refuses the line with a reason that names the refused token, and it runs no command.
Requirement: One form only
The negative search SHALL require -- before the paths when it uses one or more -e options, and MUST refuse a word between the last -e value and --.
Scenario: Both forms in one line
- WHEN A line holds
! git grep -e name literal -- src. - THEN The step refuses the line and names the two forms.
Requirement: A path that matches no file
A negative search with several -e literals SHALL pass when its paths match no file and git exits 1.
Scenario: A directory that the change deletes
- WHEN The search names a directory that the change deletes.
- THEN git exits 1 and the step passes.
Requirement: The positional literal stays
The negative search SHALL still accept one plain positional literal when the line holds no -e option.
Scenario: A committed line with one literal
- WHEN A Verification line holds
! git grep -n name -- src tests. - THEN The parser accepts the line and the step runs the same command as before.
Requirement: The documented shape
docs/TESTING.md SHALL state that the ! git grep form takes one positional literal or one or more -e literals with -- before the paths, and that a pipe, -E and -P stay refused.
Scenario: The documentation check
- WHEN The change runs
uv run devops ci docs. - THEN The check passes, and the negative-search rule holds the
-eform, the--requirement and the refused tokens.
Requirement: The plan of #2610 uses the allowed form
The Verification: line of task 3.3 in openspec/changes/2610-devops-k8s-image-pins-resolves-with/tasks.md SHALL use four -e literals in place of -E and the pipe.
Scenario: The rewritten line
- WHEN The parser reads the Verification line of task 3.3.
- THEN The parser accepts it, and the four patterns are
ImagetoolsFake,inspect_command,imagetools_recordingandimagetools_runs.
Requirement: An -e with no value
The negative search MUST refuse an -e option that has no following value or whose following word is --.
Scenario: A missing -e value
- WHEN A line holds
! git grep -e -- src. - THEN The step refuses the line with a reason that names the missing literal.
Existing Tool Considered
Git's git grep (https://git-scm.com/docs/git-grep) covers the need: -F with one -e for each literal matches any of them. Git is open and maintained. It lacks an option policy: it accepts -E, -P and a regex pattern. The step must keep its allowlist, its plain-literal check, and require -- before the paths with -e. The change uses this tool and builds no replacement, so it has no build cost.
Key questions
- Which way does the project take: repeated
-e, or one! git grepline for each name?: Repeat-e. Git matches any of the patterns in one command, so one line per group stays short. Each-evalue gets the same plain-literal check as the positional literal. (best practice) [sources: docs/TESTING.md:62, https://git-scm.com/docs/git-grep, openspec/changes/2610-devops-k8s-image-pins-resolves-with/tasks.md:30, openspec/changes/archive/2026-11-02-3263-negative-search-followup/tasks.md:26]- Chosen: Repeat -e. Git matches any pattern in one command. The fixed shape keeps each value plain, and one line covers a group.
- Rejected: One ! git grep line for each name. It adds a line or a task for each name. It cannot run the two-name search that the first criterion needs.
- Does
git grepmatch any of several-epatterns?: Yes. The synopsis ofgit grepadmits-emore than once. With no--and,--oror--all-match, a line that matches any of the patterns is a match;--all-matchis what would require all of them. The step uses no--all-match, so repeated-evalues are OR. [sources: https://git-scm.com/docs/git-grep, https://man.archlinux.org/man/git-grep.1.en] - Which options and literals does the step allow today?: The options
-n -I -F -i -w -l -c -q, one plain literal and relative paths. A pipe,;,&&, a redirect,-E,-Pand every other option are refused. The parser isread_negative_search, which holds the option letters and the literal signs, and the refusal text issearch_reason_option. [sources: docs/TESTING.md:62, src/devops_cli/roadmap/implement_shell_policy.py:153, src/devops_cli/roadmap/implement_shell_policy.py:156, src/devops_cli/roadmap/implement_shell_policy.py:252, src/devops_cli/lang/en/messages.py:2466] - Which test pins that
-eis refused today?:test_a_negative_search_outside_the_fixed_shape_is_refused_and_starts_no_processlists! git grep -e name src/with the reason "the option-eis not allowed". The change moves that case to the accepted form and keeps the other option cases. [sources: tests/roadmap/test_roadmap_implement_negative_search.py:133, tests/roadmap/test_roadmap_implement_negative_search.py:147] - Does the single positional literal stay?: Yes. Committed plans use it, such as task 1.1 of perf(k8s): use tag_digest HEAD for image pins #2610. The parser keeps it and adds the
-eform beside it. (best practice) [sources: docs/TESTING.md:62, openspec/changes/2610-devops-k8s-image-pins-resolves-with/tasks.md:10]- Chosen: Keep the positional literal and add -e. Committed plans use the positional form. Dropping it would refuse every committed line of the current shape.
- Rejected: Replace it with -e only. It refuses every committed line of the current shape. Each plan would need a rewrite.
- Is the line in group 3 of perf(k8s): use tag_digest HEAD for image pins #2610 refused under both ways?: Yes. The line holds
-Eand a pipe, and the step refuses both. The change rewrites the line to four-evalues. [sources: openspec/changes/2610-devops-k8s-image-pins-resolves-with/tasks.md:30, docs/TESTING.md:62, src/devops_cli/roadmap/implement_shell_policy.py:263] - How does the parser treat a line with both a positional literal and
-e?: It refuses the line. With-e, git reads a positional word as a path, so the line would search other paths without an error. The parser requires--before the paths when-eis used, so a word between the last-evalue and--is refused. (best practice) [sources: https://git-scm.com/docs/git-grep, docs/TESTING.md:62, src/devops_cli/roadmap/implement_shell_policy.py:157]- Chosen: Require
--before the paths with-eand refuse a word before it. The rule makes the mixed form detectable: with-e, every word before--is a positional literal and is refused. - Rejected: Let git read the positional word as a path. The search then covers other paths, and the plan does not say so.
- Rejected: Accept the mixed form. The grammar is ambiguous: a plain word is both a valid literal and a valid path, so the step cannot tell which the plan meant.
- Chosen: Require
- Which committed
tasks.mdfiles does the invariant test read?: Everytasks.mdof an active change folder underopenspec/changes/, and none underopenspec/changes/archive/. The implement step runs an active plan only, and the archive is a record. The change folder invariant test already walks the active folders by path. (best practice) [sources: docs/TESTING.md:92, tests/invariants/test_change_folders.py:1, .github/workflows/ci.yml:100]- Chosen: Read the active change folders only. The step runs an active plan only. A refused line in the archive cannot stop a step, and the archive is a record.
- Rejected: Read the archive too. An archived line never runs. A refused line there would fail the test with no fix but an edit of the record.
- Where does the test that reads every active
tasks.mdlive?: Intests/invariants/test_change_folders.py, the invariant file for change folders. Its docstring already states that every active change folder underopenspec/changes/is a plan with a task list. (best practice) [sources: docs/TESTING.md:92, tests/invariants/test_change_folders.py:1, .github/workflows/ci.yml:100]- Chosen: Add it to
tests/invariants/test_change_folders.py. docs/TESTING.md gives one invariant file for each subject, andtest_change_folders.pyis the file for change folders. - Rejected: Create
tests/invariants/test_verification_lines.py. It makes a second file for the same subject, which the one-file-per-subject rule refuses.
- Chosen: Add it to
- Does the stage gate check the paths of a negative search at plan time?: Yes.
stage_paths.pychecks the paths against the staged commit. A path that matches no file still passes, because the step runs git with--and passes on exit 1. [sources: src/devops_cli/roadmap/stage_paths.py:143, docs/TESTING.md:62] - What does
docs/TESTING.mdsay today about the negative search?: It says the! git grepform has a fixed shape: the options-n -I -F -i -w -l -c -q, one plain literal and relative paths. A pipe,;,&&, a redirect and any other option are refused. [sources: docs/TESTING.md:62]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 2, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It blocks one specific plan (#2610) but a workaround exists by writing one line per name.It removes a friction point for groups that delete several names, but the workaround keeps the workflow functional.It needs a code change to accept multiple '-e' values, tests for pass and fail cases, and a check over all committed tasks.md files.Both items work on the '! git grep' command in the implement step, but #3263 fixes the allowlist to accept the '!' prefix while this candidate extends the command to accept multiple patterns.devops-cli-service commentedon Nov 3, 2026
Status set to Ready at 1b3184b (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.
Evidence:
placeholder
fix(roadmap): name a refused verification command safely (#3293)
dan-petty commentedon Nov 4, 2026
Evaluation of 2026-11-04. Input for the invariant test of this item, which reads every active
tasks.md.origin/mainfinds 16 of 195Verification:code spans that the step refuses, in 3 folders:2441(2),2610(5) and3187(9). So the invariant test also catches the prose spans of fix(k8s): name the Loki deployment mode Monolithic #2441 and perf(k8s): use tag_digest HEAD for image pins #2610 and thetest -zspans of refactor(roadmap): group the job modules in subpackages #3187, not only the line that this item names. These plans need a rewrite in the same pull request, or through the new issuefeat(roadmap): one pass re-checks each merged plan against main.!spans intasks.mdfinds 8 folders with a span that the step would refuse: 2147, 2184, 2570, 2592, 2610, 2644, 3187 and 3373. The span in 3373 is the fragment! git grep. Many of these spans are in task text, so the step does not run them.read_verification(src/devops_cli/roadmap/implement_shell_policy.py:305-312). A plan passes only because of the reader:read_changegives only the first span of a task (_taskinplan_read.pytakestask.verification[0]), and perf(k8s): use tag_digest HEAD for image pins #2610 fails in the reader with aValidationError, socheck_proposaldoes not run on it. The new issuefix(roadmap): the plan reader reports each bad plan with no crashowns that defect.This item went back to New on 2026-11-03T01:02Z with the evidence text
placeholder. That return carries no evidence, so a person or agent must check it again.1 remaining item
devops-cli-service commentedon Nov 5, 2026
Status set to Ready at d72ec47 (see proposed design in issue body).
Moved to new items: #3579.
dan-petty commentedon Nov 5, 2026
Answer from project standards, under the owner's instruction of 2026-11-05.
Question: The branch of this item delivers criteria 1 and 2 and the #2610 part of criterion 3. It does not add the test over every
tasks.md. Does its pull request usePlans #3276orCloses #3276?Answer:
Closes #3276. The test over every activetasks.mdmoves to #3579, which already holds it. The body of this issue now lists what this item delivers and names #3579.Source:
AGENTS.mdrule 1: one pull request closes its one issue.CONTRIBUTING.md: only a plan pull request, with the titledocs(openspec): plan #<issue> <summary>, hasPlans #<issue>. This pull request is afeatthat holds code.refine.deferredis3579, comment "Moved to new items: feat(roadmap): check every active plan against the verification policy #3579"). The acceptance criteria of feat(roadmap): check every active plan against the verification policy #3579 name that test.The work of the test is separate. At the rebased head, a scan with
verification_problemfinds 15 refused commands in other active plans: #2441 (2), #2610 (4) and #3187 (9). The test cannot pass until those plans change.devops-cli-service commentedon Nov 5, 2026
Released in v0.63.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.63.0
devops-cli-service commentedon Nov 5, 2026
Live since 2026-11-05 19:48 UTC