chore(lint): apply safe ruff unused-import cleanup #811

Open
opened 2026-06-19 01:27:19 +02:00 by codex · 1 comment
Collaborator

Spec sources (whitelist)

  • pyproject.toml
  • control-plane/platformctl/ci/auto_apply_scope.py
  • control-plane/platformctl/cli.py
  • control-plane/platformctl/doctor.py
  • control-plane/platformctl/tests/test_consolidator.py
  • control-plane/platformctl/tests/test_glm_comment_hook.py
  • control-plane/platformctl/tests/test_identity_doctor.py
  • control-plane/platformctl/tests/test_negative_controls.py
  • control-plane/platformctl/tests/test_run_review.py
  • control-plane/platformctl/tests/test_smoke.py
  • control-plane/platformctl/tools/consolidate_review.py
  • control-plane/platformctl/tools/identity_doctor.py
  • control-plane/platformctl/tools/providers/_base.py
  • control-plane/platformctl/tools/run_review.py
  • control-plane/platformctl/wip.py
  • scripts/backup/unique_knowledge_backup.py

Extracted context

From Antigravity/Gemini audit, 2026-06-19:

ruff check . reported unused imports, one lambda assignment, and one unused variable.

Important observed caveat:

Do not remove pytest fixture registration imports just because ruff marks them unused.
`docker_mock` is used as a pytest fixture in test_plan_integration.py.

Do NOT read (unless escape hatch fires)

  • modules/ — module manifests are not relevant.
  • compose/ — runtime compose is not relevant.
  • state/ — status/governance docs are not relevant.

Allowed touched paths

  • The listed files only, excluding control-plane/platformctl/tests/conftest.py unless this issue is explicitly paired with the fixture issue.

Why this exists (product-first)

Mechanical lint cleanup is useful only when it reduces noise without weakening test discovery or behavior. Keeping it separate lets agents review it as a low-risk chore instead of smuggling it into functional fixes.

Why this matters now

The Antigravity branch currently mixes real fixes with broad ruff cleanup. Separating cleanup prevents a false-positive lint fix from breaking pytest fixture registration.

What "done" looks like

  • Safe unused imports and unused variables are removed.
  • Lambda assignment in test_glm_comment_hook.py is rewritten only if behavior stays equivalent.
  • control-plane/platformctl/tests/conftest.py is not emptied by this cleanup.
  • ruff check . passes or remaining findings are documented with scoped ignores.
  • Focused tests for touched control-plane files pass.

Scope

In scope:

  • Mechanically safe ruff cleanup in listed files.

Out of scope:

  • Fixture registration changes.
  • Formatting churn beyond touched lines.
  • Behavioral changes in review posting, identity doctor, backup, or platformctl CLI.

Suggested approach

  1. Start from a clean branch off origin/main.
  2. Apply only lint changes that are behavior-neutral.
  3. Keep pytest fixture imports out of this issue unless paired with explicit noqa/re-export handling.
  4. Run ruff and focused tests.

Escape hatch

If a lint finding is only safe because of dynamic pytest/plugin behavior, keep the code and add a narrow suppression with a comment. Do not delete dynamic registration blindly.

Unknowns / owner questions

  • None expected.

Risk class

  • risk/process — lint cleanup can create false confidence if it breaks dynamic test behavior.

Class of service

  • class/security-sensitive

Trace

  • Original source: Antigravity/Gemini audit reviewed in Codex side conversation, 2026-06-19.
  • Migrated by: codex, 2026-06-19.
  • Related local branch: antigravity/orders/audit-reconcile.
## Spec sources (whitelist) - `pyproject.toml` - `control-plane/platformctl/ci/auto_apply_scope.py` - `control-plane/platformctl/cli.py` - `control-plane/platformctl/doctor.py` - `control-plane/platformctl/tests/test_consolidator.py` - `control-plane/platformctl/tests/test_glm_comment_hook.py` - `control-plane/platformctl/tests/test_identity_doctor.py` - `control-plane/platformctl/tests/test_negative_controls.py` - `control-plane/platformctl/tests/test_run_review.py` - `control-plane/platformctl/tests/test_smoke.py` - `control-plane/platformctl/tools/consolidate_review.py` - `control-plane/platformctl/tools/identity_doctor.py` - `control-plane/platformctl/tools/providers/_base.py` - `control-plane/platformctl/tools/run_review.py` - `control-plane/platformctl/wip.py` - `scripts/backup/unique_knowledge_backup.py` ## Extracted context > From Antigravity/Gemini audit, 2026-06-19: > ```text > ruff check . reported unused imports, one lambda assignment, and one unused variable. > ``` > > Important observed caveat: > ```text > Do not remove pytest fixture registration imports just because ruff marks them unused. > `docker_mock` is used as a pytest fixture in test_plan_integration.py. > ``` ## Do NOT read (unless escape hatch fires) - `modules/` — module manifests are not relevant. - `compose/` — runtime compose is not relevant. - `state/` — status/governance docs are not relevant. ## Allowed touched paths - The listed files only, excluding `control-plane/platformctl/tests/conftest.py` unless this issue is explicitly paired with the fixture issue. ## Why this exists (product-first) Mechanical lint cleanup is useful only when it reduces noise without weakening test discovery or behavior. Keeping it separate lets agents review it as a low-risk chore instead of smuggling it into functional fixes. ## Why this matters now The Antigravity branch currently mixes real fixes with broad ruff cleanup. Separating cleanup prevents a false-positive lint fix from breaking pytest fixture registration. ## What "done" looks like - [ ] Safe unused imports and unused variables are removed. - [ ] Lambda assignment in `test_glm_comment_hook.py` is rewritten only if behavior stays equivalent. - [ ] `control-plane/platformctl/tests/conftest.py` is not emptied by this cleanup. - [ ] `ruff check .` passes or remaining findings are documented with scoped ignores. - [ ] Focused tests for touched control-plane files pass. ## Scope **In scope:** - Mechanically safe ruff cleanup in listed files. **Out of scope:** - Fixture registration changes. - Formatting churn beyond touched lines. - Behavioral changes in review posting, identity doctor, backup, or platformctl CLI. ## Suggested approach 1. Start from a clean branch off `origin/main`. 2. Apply only lint changes that are behavior-neutral. 3. Keep pytest fixture imports out of this issue unless paired with explicit noqa/re-export handling. 4. Run ruff and focused tests. ## Escape hatch If a lint finding is only safe because of dynamic pytest/plugin behavior, keep the code and add a narrow suppression with a comment. Do not delete dynamic registration blindly. ## Unknowns / owner questions - None expected. ## Risk class - [x] `risk/process` — lint cleanup can create false confidence if it breaks dynamic test behavior. ## Class of service - [ ] `class/security-sensitive` ## Trace - Original source: Antigravity/Gemini audit reviewed in Codex side conversation, 2026-06-19. - Migrated by: codex, 2026-06-19. - Related local branch: `antigravity/orders/audit-reconcile`.
Collaborator

Iskra judgment

Field Value
Target pdurlej/platform#issue#811
Priority p3
Action codex_candidate
Scores reach 2 / impact 2 / confidence 4
Piotr fit medium
Effort small
Labels judge/p3, judge/codex-candidate
Judge iskra via openclaw

Rationale: This is a low-risk lint cleanup with explicit source files and no production mutation, suitable for Codex but not strategically urgent.

Caveat: The judgment is based on the supplied audit excerpt rather than a fresh lint run or full repository inspection.

Structured openclaw.judge.v0 payload
<!-- openclaw.judge.v0 -->
{
  "confidence": 4,
  "effort_hint": "small",
  "escalation": {
    "kind": "none",
    "reason": ""
  },
  "evidence_refs": [
    {
      "note": "Public repository metadata and dry-run packet only.",
      "type": "snapshot",
      "value": "issue-or-pr-title-body-labels-and-target-snapshot"
    }
  ],
  "impact": 2,
  "judge_actor": {
    "name": "iskra",
    "runtime": "openclaw"
  },
  "judged_at": "2026-06-21T00:00:00Z",
  "labels_to_apply": [
    "judge/p3",
    "judge/codex-candidate"
  ],
  "piotr_fit": "medium",
  "priority": "p3",
  "rationale_summary": "This is a low-risk lint cleanup with explicit source files and no production mutation, suitable for Codex but not strategically urgent.",
  "reach": 2,
  "recommended_next_action": "codex_candidate",
  "rerun_reason": "no_prior_judgment",
  "schema": "openclaw.judge.v0",
  "target": {
    "kind": "issue",
    "number": 811,
    "repo": "pdurlej/platform"
  },
  "target_snapshot": {
    "body_hash": "sha256:4e37ef801c8b1315bcffba57d973d4c585f31628c2ef01bd2d4f226b6227f5c6",
    "commit_count": null,
    "evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "head_sha": null,
    "labels": [
      "agent/codex",
      "domain:ci",
      "proposed",
      "risk/process",
      "safety:no-prod-mutation",
      "size/small",
      "source/agent-generated",
      "type:chore"
    ],
    "labels_hash": "sha256:6d13047c9aec7b39bbfa1f856853f912f9ab83e0f6c412d3feaa5bb9c3b614e4",
    "state": "open",
    "title_hash": "sha256:a84fb903bdb4db0402d6da09bf0fc1644c5f6a4026b2815b268a1e633d652c2d",
    "updated_at": "2026-06-19T01:27:19+02:00"
  },
  "top_caveat": "The judgment is based on the supplied audit excerpt rather than a fresh lint run or full repository inspection."
}
<!-- /openclaw.judge.v0 -->
### Iskra judgment | Field | Value | | --- | --- | | Target | `pdurlej/platform#issue#811` | | Priority | p3 | | Action | codex_candidate | | Scores | reach 2 / impact 2 / confidence 4 | | Piotr fit | medium | | Effort | small | | Labels | `judge/p3`, `judge/codex-candidate` | | Judge | `iskra` via `openclaw` | **Rationale:** This is a low-risk lint cleanup with explicit source files and no production mutation, suitable for Codex but not strategically urgent. **Caveat:** The judgment is based on the supplied audit excerpt rather than a fresh lint run or full repository inspection. <details> <summary>Structured openclaw.judge.v0 payload</summary> ```json <!-- openclaw.judge.v0 --> { "confidence": 4, "effort_hint": "small", "escalation": { "kind": "none", "reason": "" }, "evidence_refs": [ { "note": "Public repository metadata and dry-run packet only.", "type": "snapshot", "value": "issue-or-pr-title-body-labels-and-target-snapshot" } ], "impact": 2, "judge_actor": { "name": "iskra", "runtime": "openclaw" }, "judged_at": "2026-06-21T00:00:00Z", "labels_to_apply": [ "judge/p3", "judge/codex-candidate" ], "piotr_fit": "medium", "priority": "p3", "rationale_summary": "This is a low-risk lint cleanup with explicit source files and no production mutation, suitable for Codex but not strategically urgent.", "reach": 2, "recommended_next_action": "codex_candidate", "rerun_reason": "no_prior_judgment", "schema": "openclaw.judge.v0", "target": { "kind": "issue", "number": 811, "repo": "pdurlej/platform" }, "target_snapshot": { "body_hash": "sha256:4e37ef801c8b1315bcffba57d973d4c585f31628c2ef01bd2d4f226b6227f5c6", "commit_count": null, "evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "head_sha": null, "labels": [ "agent/codex", "domain:ci", "proposed", "risk/process", "safety:no-prod-mutation", "size/small", "source/agent-generated", "type:chore" ], "labels_hash": "sha256:6d13047c9aec7b39bbfa1f856853f912f9ab83e0f6c412d3feaa5bb9c3b614e4", "state": "open", "title_hash": "sha256:a84fb903bdb4db0402d6da09bf0fc1644c5f6a4026b2815b268a1e633d652c2d", "updated_at": "2026-06-19T01:27:19+02:00" }, "top_caveat": "The judgment is based on the supplied audit excerpt rather than a fresh lint run or full repository inspection." } <!-- /openclaw.judge.v0 --> ``` </details>
Sign in to join this conversation.
No labels
W6d-automerge-calibration
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
automerge-candidate
class/security-sensitive
cutover-gate
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
iterating
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
large-impact
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
meta
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
needs-operator-decision
needs-triage
not-ready
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
operator-emotional
owner-attention
phase/02
phase/03
priority:p0
priority:p1
priority:p2
priority:p3
proposed
ready-for-agent
ready-for-operator
recovery
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
risk/exposure
risk/process
risk/product
risk/runtime
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
size/large
size/medium
size/small
size/tiny
size/unknown
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tier/full
tier/lite
tier/stacked
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/platform#811
No description provided.