Skip to content

docs(openspec): plan #2636 make clean-default model fields required - #3132

Merged
dan-petty merged 5 commits into
mainfrom
fix/2636-a-result-that-no-lookup-marked
Nov 2, 2026
Merged

dan-petty merged 5 commits into
mainfrom
fix/2636-a-result-that-no-lookup-marked

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Plans #2636

This plan makes two security status fields required and removes two unused models. NetworkReference.security_status and PackageLookupResult.status no longer default to a clean value. A producer that forgets to set the field now gets a validation error. NetworkIntelResult and PackageIntelResult are removed from the models package because no code in src/ uses them. The models package all no longer lists the removed models. Tests that built the removed models are updated. Ten existing test calls that omit the new required fields are updated. This removes the remaining four clean-default fields that #2504 left.

Change: openspec/changes/2636-a-result-that-no-lookup-marked/

@devops-cli-service
devops-cli-service Bot marked this pull request as ready for review November 1, 2026 23:28
@dan-petty

Copy link
Copy Markdown
Owner

Advisory pre-merge review (automated; a person decides).

Recommendation: hold. The plan breaks the test suite after group 1, and its Feasibility section holds no evidence.

Severity Where Problem Evidence Fix
major tasks.md group 1; proposal.md Impact No task fixes the existing tests that build the two models without the new required field. These tests fail after task 1.2. Calls that omit security_status: tests/review/test_report.py:160, tests/security/test_osv_scanner.py:349, tests/security/test_reference_report_order.py:28, tests/security/test_vulnerability_lookup.py:593, tests/ai/test_review_finding_losses.py:47, tests/ai/review/test_review_report_summary.py:231 and :232, tests/ai/review/test_review_pipeline.py:782 and :783. PackageLookupResult() without status at tests/security/test_vulnerability_lookup.py:717 (test_package_lookup_result_defaults asserts the removed default "ok"). No call in src/ omits the field. Impact lists only tests/models/test_resource_schemas.py. Add a task that sets the field at each call site. Rewrite or delete test_package_lookup_result_defaults. Add the files to Changes and Impact, and run them in the verify command.
major proposal.md Feasibility Feasibility holds no result. It says "run ... to confirm" and shows no output or version. One bullet only repeats the issue text. Both "First check" and "Second check" bullets have no output. The lens ran both commands: they print the clean defaults, so the premise holds. Write the command outputs, the grep result for the two intel models in src/ and tests/, and the version.
minor tasks.md task 1.2 The instruction does not match the code. It says to change the Field first argument. The two fields are plain annotations. src/devops_cli/models/vulnerability.py:54 status: str = "ok"; line 79 security_status: str = "✓ Safe". Write: remove the default from both annotations.
minor tasks.md No archive group. AGENTS.md rule 1 needs the last commit to archive the change. tasks.md ends at group 3 and "Workflow follow-up". Add a group "Archive" with uv run devops openspec archive 2636-a-result-that-no-lookup-marked.
minor spec.md; tasks.md 3.1, 3.2 The issue says the package exports are updated. The spec has no requirement for it, and no test proves the __all__ edit. src/devops_cli/models/init.py lines 125, 127, 247, 251 hold the names. Task 3.1 tests only ImportError. Add a scenario or check that the names are not in devops_cli.models.__all__.
nit PR body The body says "This closes the remaining four clean-default fields identified in #2504". A plan PR must not use a close word near an issue number. PR body text. The first line is "Plans #2636". GitHub links a keyword only when it directly precedes #N, so this probably closes nothing. Use a neutral word, for example "This removes".

Checks that ran (by the lens):

  • Paths in Reads and Changes exist at origin/main.
  • openspec validate 2636-a-result-that-no-lookup-marked --strict passes.
  • uv run devops openspec check passes.
  • AST scan of the review worktree for calls that omit the two fields (results above).
  • Both repro commands from the proposal ran. The premise holds.
  • All src/ constructors already set both fields, so the src change is safe.
  • I re-checked the call sites at tests/review/test_report.py:160, tests/ai/review/test_review_pipeline.py:782 and tests/ai/review/test_review_report_summary.py:231 in the PR tree. They omit the field.

Add tasks that fix the 10 test calls that omit the required fields. Add Feasibility evidence, an archive group and a check of the models __all__ edit. Correct the Field instruction.
@dan-petty

Copy link
Copy Markdown
Owner

Fixes for the review findings (commit 76cba99):

  • Tasks: group 1 now fixes the 10 test calls that omit the new required fields (9 NetworkReference calls in 7 files, 1 PackageLookupResult call). Task 1.4 rewrites test_package_lookup_result_defaults. Task 1.5 scans src and tests for any other call and runs all affected test files.
  • Proposal: Impact and What Changes list the new test files. Feasibility now holds real command output at origin/main 5ac0bea: the pydantic version (2.13.5), the current defaults, the grep results for the two intel models, and the call-site scan.
  • Task 1.2 now says to remove the default from the two plain annotations. It no longer says to change a Field argument.
  • Spec and tasks 3.1 and 3.2: new scenarios and a test check that the removed names are not in devops_cli.models.__all__.
  • Tasks: new group 4 archives the change in the last commit.
  • PR body: the close word near fix(security): a failed shodan internetdb lookup has outcome failed, so a review never shows its address as safe #2504 is gone. The body says "Plans fix(models): make clean-default model fields required #2636".

Also merged origin/main into the branch. uv run devops openspec check and tests/invariants/test_change_folders.py pass.

@dan-petty

Copy link
Copy Markdown
Owner

Advisory pre-merge review (automated; a person decides).

Recommendation: merge after minor fixes. The plan is sound. Two small task texts need a fix before work starts.

Severity Where Problem Evidence Fix
minor tasks.md, task 2.1 The task says to remove all test functions that use the two intel models. Only one function uses them. That function also covers other models. A reader who follows the words could delete that coverage. In tests/models/test_resource_schemas.py, PackageIntelResult( is at line 270 and NetworkIntelResult( is at line 281. Both are inside test_security_resource_models_roundtrip (line 248 to line 307). The next function starts at line 308. The imports are at lines 80 and 82. Reword 2.1: remove only the two statements and the two imports from test_security_resource_models_roundtrip. Keep the other assertions.
minor tasks.md, task 1.5 The task names an AST scan. The scan is a scratch script that is not in the repository. A reader cannot repeat it. The full test run in the same task would catch a missed call. Proposal Feasibility check 3 says the script is under .data/agent/scratch/. A second scan of the PR head found the same 10 calls. Drop the AST scan step and rely on the test run. Or give a command that a reader can repeat.
nit specs/threat-intel-lookup-outcome/spec.md, requirements 3 and 4 The two removal requirements describe dead code. No user can see it. grep for NetworkIntelResult and PackageIntelResult in src finds no use outside src/devops_cli/models/. The issue lists the removal as acceptance criteria, so keeping them is allowed. Optional. Keep the required-field requirements. Drop the two removal requirements. The tests in group 3 prove the removal.

What I checked and found correct:

  • Premise: the defaults are at vulnerability.py lines 54 and 79. The two intel classes are at security.py lines 60 and 80. Only tests/models/test_resource_schemas.py uses them. Issue fix(models): make clean-default model fields required #2636 is open. No newer work did this.
  • Scope: each acceptance criterion of fix(models): make clean-default model fields required #2636 maps to a task group. The plan adds nothing extra.
  • Call sites: a scan of src and tests finds exactly the 10 calls that the plan lists (9 NetworkReference calls in 7 files, and 1 PackageLookupResult call). No call uses **kwargs.
  • Stored data: NetworkReference is a field of stored payloads. The repository has no exclude_defaults or exclude_unset call on them, so stored data always holds the field. A test parse of a reply that holds only {"target": "example.com"} still returns (1, [], []) with the field required.
  • Order: group 1, then group 2, then group 3. No group needs what a later group creates.
  • All paths in the plan exist on main. The verify commands use uv run devops ci test, and that command exists.
  • OpenSpec: uv run devops openspec check passes. openspec validate 2636-a-result-that-no-lookup-marked --strict passes.
  • PR text: the title is a Conventional Commit. The body starts with "Plans fix(models): make clean-default model fields required #2636" and has no closing keyword.

Checks that I ran: the lens checks above on the PR head, plus a read of the task file and of tests/models/test_resource_schemas.py on main to confirm the line numbers in the first finding.

…rements in the #2636 plan

Task 2.1 names the exact test lines to remove. Task 1.5 uses a grep that a reader can repeat. The spec has one removal requirement.
@dan-petty
dan-petty merged commit f1f5a9a into main Nov 2, 2026
19 checks passed
@dan-petty
dan-petty deleted the fix/2636-a-result-that-no-lookup-marked branch November 2, 2026 01:03
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