Repository navigation
feat(review): review finding remediation, github project automation, and runtime duration formatting - #49
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Multiple new verification/redaction heuristics are overly broad and can mis-handle non-secret settings and incorrectly invalidate real findings, so they should be tightened before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR remediates issues from review session 20260906-164259 and strengthens the AI review verification/self-improvement loop by adding deterministic invalidation for common hallucinations, tightening redaction/masking behavior, and expanding regression tests and documentation.
Changes:
- Fix dry-run state leakage by restoring the prior dry-run state via
try/finallyin the dry-run decorator. - Add recursive config redaction for the server
/configendpoint and improve URI credential masking edge-case handling. - Harden review verification by adding cross-module import symbol grounding, missing-header/missing-symbol hallucination invalidation, and updating the hallucinations catalog + prompts/docs/tests.
File summaries
| File | Description |
|---|---|
| tests/test_server.py | Adds coverage for recursive config redaction helper behavior. |
| tests/test_review_findings_remediation_164259.py | New end-to-end regression tests validating all remediations and deterministic invalidation rules. |
| tests/test_consolidation_security_sanitizer.py | Expands credential-masking edge-case coverage (missing username + fallback). |
| tests/test_consolidation_dry_run_decorator.py | Strengthens dry-run decorator tests for state restoration and exception paths. |
| src/devops_cli/server/routes/workspace.py | Implements _redact_config_dict and secret-field predicate for /config sanitization. |
| src/devops_cli/security/sanitizer.py | Refines mask_uri_credentials to avoid malformed :***@ output when username is empty. |
| src/devops_cli/dry_run/decorator.py | Ensures dry-run state is restored after rendering (normal + exception paths). |
| src/devops_cli/ai/tasks/verify_finding_system.md | Updates verification rules to require cross-module symbol and dynamic header grounding. |
| src/devops_cli/ai/tasks/review.md | Updates review instructions to avoid missing-symbol and missing-header false positives. |
| src/devops_cli/ai/review/verification.py | Adds deterministic pre-verification checks for missing-symbol and missing-header hallucinations. |
| src/devops_cli/ai/review/common_hallucinations.py | Adds cross-module symbol resolution helpers and extends ground-truth verification logic. |
| src/devops_cli/ai/review/common_hallucinations.json | Broadens missing-symbol signatures and adds a missing-header hallucination entry. |
| src/devops_cli/ai/personas/devsecops/prompt.md | Updates security persona guidance to trace dynamic header configuration. |
| src/devops_cli/ai/knowledge_base/devops_cli/tasks/ai_code_review.md | Documents new grounding behaviors for imported symbols and dynamic headers. |
| docs/LOG.md | Adds a dated changelog entry summarizing the remediations and hardening work. |
| docs/agent/task.md | Updates the WIP task list to reflect Phase 48.5 progress and next steps. |
Review details
Suppressed comments (1)
src/devops_cli/ai/review/common_hallucinations.py:589
verify_ground_truth_hallucinationtreats the mere presence of the string "Authorization" as ground-truth that a missing-header claim is false. This can incorrectly invalidate real missing-header findings if the token appears in comments, constants, or unused code. Tighten the check to require evidence of assigning into aheadersdict and passing that dict to a request (e.g.headers=headers).
if "header" in entry.id.lower():
raw_text = file_path.read_text(encoding="utf-8", errors="replace")
return any(
pattern in raw_text
for pattern in (
'headers["Authorization"]',
"headers['Authorization']",
'"Authorization":',
"'Authorization':",
)
)
- Files reviewed: 16/16 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ubmodule test grouping
Upgrade format_duration to support microsecond, millisecond, second, minute, hour, and day formatting across CLI command completion, CI summaries, AI reviews, and benchmarks.
Ensure milestone descriptions extracted from roadmap use strictly the feature name without appending status strings in parentheses.
* feat(devcontainer): automate PR devcontainer cleanup on PR merge in GHCR (#44) * feat(devcontainer): automate PR devcontainer cleanup on PR merge in GHCR - Add GitHub Actions workflow .github/workflows/cleanup-devcontainer.yml triggered on pull_request [closed] and workflow_dispatch - Scope GHCR image pruning to pr-<number> or wildcard tags while preserving release tags (latest, v*, main) - Reclaim multi-architecture storage via delete-untagged and delete-ghost-images - Pin dataaxiom/ghcr-cleanup-action to commit SHA for supply chain security - Enhance devops_cli.commands.gh token resolution (Keyring github.token and gh auth token) and use REST API for milestones - Update agent instructions in AGENTS.md, ROUTINE_TASKS.md, docs/agent/README.md to leverage GitHub project integrations and issue tracking - Sync roadmap milestones and track Phase 47.4 deliverables Closes #39 * docs(task): update Phase 47.4 tracking with PR 44 and commit 21711bd * fix(gh): support DEVOPS_CLI_GITHUB_TOKEN and add pagination to milestone api - Address Copilot review comments on PR #44 - Check DEVOPS_CLI_GITHUB_TOKEN in _get_github_client() - Pass --paginate and per_page=100 in _get_repo_milestones() - Add regression tests in tests/test_gh_cmd.py * feat(ci): pin GitHub Actions to immutable commit SHAs (#45) * feat(ci): pin GitHub Actions to immutable commit SHAs * docs(task): update Phase 48.1 tracking with PR 45 * docs(roadmap): update action SHA pinning status to completed * docs(task): record Copilot review resolution on PR 45 * feat(security): isolate subprocess environment and enforce credential boundary (#46) * feat(security): isolate subprocess environment and enforce credential boundary * fix(security): normalize env var key case for cross-platform matching and ensure test determinism * docs(task): update Phase 48.2 tracking with PR #46 and Copilot review resolution * feat(k8s): cluster default-deny NetworkPolicies for monitoring and argocd namespaces (#47) * feat(k8s): cluster default-deny NetworkPolicies for monitoring and argocd namespaces * fix(k8s): address Copilot review on NetworkPolicy ingress comments, API server egress selector, and test assertions * docs(task): record PR #47 and Copilot review remediation in Phase 48.3 tracking * feat(security): qdrant vector database api key secret protection and clusterip default (#48) * feat(security): qdrant vector database api key secret protection and clusterip default * fix(review): address Copilot findings for stdin secret apply, fail-fast lifecycle, and debug logging * docs(agent): update task tracking for PR #48 and Copilot review resolutions * docs(agent): record Phase 48.4 PR #48 squash-merge and issue #43 closure * feat(review): review finding remediation, github project automation, and runtime duration formatting (#49) * refactor(review): address session 164259 findings and harden self-improvement loop * docs(agent): mark Phase 48.5 task completed and PR 49 verified * feat(github): remote project sync, automated milestone closure, and submodule test grouping * feat(devcontainer): enhance mcp lifecycle sync and enforce commit message hygiene * feat(output): format command elapsed duration in human readable units Upgrade format_duration to support microsecond, millisecond, second, minute, hour, and day formatting across CLI command completion, CI summaries, AI reviews, and benchmarks. * refactor(github): omit status from milestone description Ensure milestone descriptions extracted from roadmap use strictly the feature name without appending status strings in parentheses. * feat(valkey): valkey workstation caching, rate limiting, and v0.2.12 release preparation - Implement pure-Python RESP2/RESP3 encoder and stream parser without C dependencies - Add TCP socket client (ValkeyClient) with connection pooling, timeouts, and zero-trust SSRF validation - Implement atomic token bucket rate limiter with embedded Lua script - Implement distributed AI cache provider (ValkeyCacheProvider) for embeddings and review findings - Implement devops valkey CLI command group (ping, info, stats, keys, get, set, flush, backup, cli) - Register 6 FastMCP Valkey tools and dynamic system resource resource://valkey/status - Bump package version to 0.2.12 and synchronize release documentation - Pass all 10 devops ci quality gates with 95% test coverage * docs(agents): codify strict release PR title convention feat(release): v<version> * fix(review): remediate pull request review findings across valkey, output, and github subsystems
Summary of Changes
This pull request implements comprehensive quality remediations across code review defenses, GitHub Projects v2 automation, release milestone lifecycle management, human-readable command duration formatting, submodule-aligned test organization, and DevContainer MCP lifecycle sync.
1. Code Review Finding Remediation & Verification Hardening
src/devops_cli/dry_run/decorator.pywithoriginal_dry_run = is_dry_run()andtry...finally: set_dry_run(original_dry_run)to guarantee state restoration across both normal returns and exception paths._redact_config_dictinsrc/devops_cli/server/routes/workspace.pysupporting arbitrarily nested configurations and sensitive key patterns while explicitly preserving boolean configuration flags (such asai.allow_private_network).mask_uri_credentialsinsrc/devops_cli/security/sanitizer.py, rendering clean***@hostrather than:***@host, and required colon delimiters in the fallback regex to preserve usernames without passwords._check_imported_module_for_symbol,_find_module_file_candidates, and_file_defines_symbolinsrc/devops_cli/ai/review/common_hallucinations.pyto trace imported symbols across repository modules using AST inspection, prioritizing backticked code symbols.src/devops_cli/ai/review/verification.pyrequiring evidence of bothheadersdictionary assignment and request dispatch (headers=headers) before falsifying missing-header claims.verify_finding_system.md,review.md) and knowledge base articles (ai_code_review.md).2. GitHub Projects v2 & Milestone Lifecycle Automation
verify_project_auth_scopes()insrc/devops_cli/github/projects.pyto inspect token scopes forproject/read:projectand provide actionable guidance. Implementedsync_remote_project(),devops gh project sync --no-dry-run, anddevops gh project link <number>.devops gh milestones close <version>), integrated intorelease_tagautomated execution and.github/workflows/release.ymlwithissues: writepermissions.extract_roadmap_milestones()insrc/devops_cli/github/milestones.pyto assign milestone descriptions strictly using the feature name, omitting redundant parenthesized roadmap status markers (e.g.(Scheduled)/(Completed)).gh_project_syncandgh_milestone_closeon the FastMCP server.3. Human-Readable Elapsed Duration Output
format_duration()insrc/devops_cli/output/formatters/scalars.pyto scale raw seconds into human-readable units across all operational ranges:< 0.001s500µs,3µs)< 1.0s50.0ms,717.1ms)< 60.0s2.50s,59.90s)< 3600.0s1m 5s,1m 16.33s,2m)< 86400.0s1h,1h 1m 5s)1d,1d 1h 1m)src/devops_cli/main.py), CI summary tables (src/devops_cli/commands/ci.py), sandbox execution logs, AI benchmark reports, and review stages.src/devops_cli/lang/en/messages.pyto use{elapsed}.4. Submodule-Aligned Test Organization & Agent Governance
AGENTS.mdanddocs/ROUTINE_TASKS.md, deprecating and eliminating arbitrary one-off test files.tests/test_consolidation_dry_run_decorator.pytests/test_server.pytests/test_consolidation_security_sanitizer.pytests/test_review_verification.pytests/test_github_milestones.pytests/test_github_projects.pytests/test_output.pyAGENTS.mdprohibiting internal references/numeric IDs in commit messages and forbidding standalone commits containing solely agent tracking documentation.devops devcontainer post-createandpost-startto invoke_sync_mcp_configuration, ensuring on-demand tool discovery is fully provisioned before editor launch. Fixedbranches_listFastMCP tool argument from--remoteto--all.Verification & Quality Gates
tests/test_architectural_invariants.py.ruff,ruff-format, trailing whitespace, end-of-file, large files, private keys, merge conflicts).uv run devops ci):