Skip to content

feat: add configurable scan artifacts#48

Merged
tachyon-beep merged 1 commit into
mainfrom
codex/configurable-scan-artifacts
Jun 20, 2026
Merged

feat: add configurable scan artifacts#48
tachyon-beep merged 1 commit into
mainfrom
codex/configurable-scan-artifacts

Conversation

@tachyon-beep

@tachyon-beep tachyon-beep commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Why

Default wardline scan output previously wrote fixed filenames in the scan root, which made repeat scans overwrite each other and left artifact retention entirely manual. This adds a config-driven artifact directory with timestamped filenames and built-in retention while preserving exact explicit --output behavior.

What Changed

  • Added [wardline.artifacts] config with dir = ".wardline" and retain = 20 defaults.
  • Added managed timestamped scan artifacts for JSONL, SARIF, agent-summary, and legis outputs.
  • Added collision-resistant exclusive-create writes and retention that only prunes Wardline-managed artifacts for the same format.
  • Updated docs, examples, .gitignore, changelog, and bumped Wardline to 1.0.6.

Verification

  • Subagent review: config/artifact reviewer clear after fixes; CLI/tests reviewer clear after fixes; docs/release reviewer clear.
  • uv run pytest tests/unit/core/test_config.py tests/unit/cli/test_cli.py tests/unit/cli/test_agent_summary_cmd.py tests/unit/security/test_symlink_toctou_hardening.py -q -> 188 passed
  • uv run pytest --cov=wardline --cov-report=term-missing --cov-fail-under=90 -> 4200 passed, 18 deselected, coverage 92.32%
  • uv run ruff check src tests -> passed
  • uv run ruff format --check src tests -> passed
  • uv run mypy -> passed
  • uv run wardline scan . --fail-on ERROR -> passed, 0 active
  • uv build -> built wardline-1.0.6 sdist/wheel
  • uv run --with twine twine check dist/* -> passed

@tachyon-beep
tachyon-beep force-pushed the codex/configurable-scan-artifacts branch from 8c49714 to 005be60 Compare June 20, 2026 00:05
@tachyon-beep
tachyon-beep merged commit 3adee22 into main Jun 20, 2026
8 checks passed
@tachyon-beep
tachyon-beep deleted the codex/configurable-scan-artifacts branch June 20, 2026 00:08

@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: 8c49714798

ℹ️ 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 src/wardline/cli/scan.py
)
jsonl_sink.write(findings)
if output_is_default:
output = write_scan_artifact(path, fmt, cfg, "".join(f"{finding.to_jsonl()}\n" for finding in findings))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep doctor aligned with default artifact paths

Default JSONL scans now write through write_scan_artifact() under [wardline.artifacts].dir, but doctor still validates only root/findings.jsonl in _check_scan_output_path. In a repo where .wardline or a configured artifact dir is a symlink/blocked path, wardline doctor can report scan.output_path as ok even though this default scan exits 2; conversely it can flag a findings.jsonl directory that scans no longer use.

Useful? React with 👍 / 👎.

)
from wardline.core.safe_paths import safe_read_text_if_regular

DEFAULT_ARTIFACT_DIR = ".wardline"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Ensure installed projects ignore the artifact directory

Switching the default from findings.jsonl to .wardline/... means existing projects that already ignored the old default path will start getting untracked Wardline artifacts from a plain wardline scan unless install/doctor also adds [wardline.artifacts].dir to their ignore rules. This is especially visible for the generated pre-commit hook and for signed legis handoffs, where Wardline's own untracked artifacts make git status --porcelain dirty and can cause signing to be refused.

Useful? React with 👍 / 👎.

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