Skip to content

Harden workflows; add Dependabot, security policy and citation - #6

Open
heykav wants to merge 3 commits into
mainfrom
claude/hardening
Open

heykav wants to merge 3 commits into
mainfrom
claude/hardening

Conversation

@heykav

@heykav heykav commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Scheduled workflow: decision

daily-maintenance.yml is removed and replaced by scheduled-check.yml.

Why:

  • Its design was the risk the audit flagged. Had it parsed, it would have run an AI agent unattended every day with contents: write and pull-requests: write, an OAuth secret in the job, and a PR opened by the bot. Nothing about the maintenance it describes needs to happen unattended.
  • What was worth keeping is the signal: finding out when something breaks without anyone pushing. Runtime and dev dependencies are unpinned, so a new pandas, numpy, typer or mypy release can break the project silently.

The replacement runs weekly (and on workflow_dispatch) on Python 3.10 and 3.12, installs the latest dependency releases, and runs the same lint, format, type and test steps as CI. It has permissions: contents: read, checks out without persisted credentials, uses no secrets and writes nothing. A failure shows up as a failed run; fixing it is a normal PR.

The CLAUDE_CODE_OAUTH_TOKEN repository secret is no longer referenced by any workflow. This PR does not touch secrets; removing it is left to the owner.

Other changes

  • ci.yml: top-level permissions: contents: read; persist-credentials: false on checkout.
  • sync-web-demo.yml: top-level contents: read, with contents: write scoped to the single job that pushes the copied files. Behaviour is unchanged: it copies src/quantdeck into docs/quantdeck_src on pushes to main that touch the engine and commits only if something changed. It takes no untrusted input. Credentials are still persisted there because the job pushes.
  • .github/dependabot.yml: pip and github-actions, weekly, minor and patch updates grouped per ecosystem.
  • SECURITY.md: private reporting via GitHub private vulnerability reporting or heykavofficial@gmail.com, best effort, latest main only. Also states that strategy files are imported and run as trusted code by design.
  • CITATION.cff: author Krishna Anubhav, version 0.1.0, MIT, no DOI. Validated with cffconvert --validate.
  • .coverage was committed by mistake; it is now untracked and coverage output is ignored.

Not changed

  • Action SHA pinning. actions/checkout@v4 and actions/setup-python@v5 are still referenced by tag. The GitHub tools available in this session cannot read the actions/* repositories, so the commit SHAs could not be resolved from a trusted source, and I did not want to pin to SHAs taken from memory. Dependabot's github-actions updates will keep the tags current; pinning can be done in a follow-up.
  • README and docs. Checked for wording that implies live execution, real-money trading or profitability; none found. The README already states there is no live or paper-trading engine and that PaperBroker only simulates fills inside a backtest. It makes no test-count claims. The quickstart output was re-run and matches.
  • LICENSE is MIT, matching pyproject.toml and the README.

Verification

Locally on Python 3.10 with pip install -e ".[dev]":

  • pytest: 76 passed (also with --cov=quantdeck)
  • ruff check .: passed
  • ruff format --check src tests examples scripts: passed
  • mypy (strict): no issues
  • All workflow YAML files parse.

CI on this PR: test (3.10), test (3.11), test (3.12) all pass.

- Replace daily-maintenance.yml with scheduled-check.yml. The old file was
  invalid YAML (a column-0 line inside a run block), so it never ran on
  schedule and failed on every push. It was also designed to let an AI
  agent edit the repo unattended with contents/pull-requests write and an
  OAuth secret. The replacement is a weekly, read-only run of lint, types
  and tests against the latest dependency releases.
- ci.yml: top-level permissions contents: read; checkout without
  persisted credentials.
- sync-web-demo.yml: top-level contents: read, write scoped to the one
  job that pushes.
- Add .github/dependabot.yml (pip and github-actions, weekly, minor and
  patch grouped), SECURITY.md and CITATION.cff.
- Stop tracking the .coverage data file and ignore coverage output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A42wbaQJVk97N5TsWqXP4G
@heykav
heykav marked this pull request as ready for review October 3, 2026 19:25
main only repaired the YAML of daily-maintenance.yml. The hardening branch
deletes that workflow on purpose: it ran an AI agent unattended with
contents and pull-requests write access plus an OAuth secret.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A42wbaQJVk97N5TsWqXP4G

This branch has not been deployed

No deployments
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.

2 participants