7 Commits

Author SHA1 Message Date
Przemek Smyrdek 7fbe39eb5e feat: auto-register the surrounding product repo as first base repo (#27)
Running 'bench-kit init' from inside a product repo is the common flow,
so init now detects the git repo containing the invocation cwd (git
rev-parse --show-toplevel + origin remote + HEAD) and replaces the
template's demo-app placeholder in bench.config.yaml with that repo,
editing the YAML document in place so company-zone comments survive.
The detection also lands in instance.json (incl. HEAD as a candidate
pin for the first task). No detection, no origin, or detecting the
instance itself → the placeholder stays. Adds the 'yaml' dependency.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 20:55:12 +02:00
“mkczarkowski” c5ed0b6778 chore: lock dependencies to stable versions 2026-05-18 16:06:05 +02:00
“mkczarkowski” 92d24ac4b4 fix(ci): add missing conventional-recommended-bump dependency and improve release error handling
The release workflow silently skipped every release because auto-version.mjs
imported conventional-recommended-bump which was never in devDependencies.
The error handler treated the import crash as "no bump needed." Now the
dependency is installed and the bump step distinguishes expected skip (exit 1)
from real crashes (any other non-zero exit).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 19:53:37 +02:00
“mkczarkowski” 40e5b37b4f feat(ci): add release workflow with npm publish, cross-platform binaries, and GitHub Releases
- Auto-version from conventional commits (auto-version.mjs) with git-diff
  gate: only releases when src/ or package.json actually changed
- 5-platform binary builds (linux x64/arm64, macOS x64/arm64, windows)
- npm publish with auth token wiring
- GitHub Release with auto-generated notes and binary attachments
- Smoke tests for package tarball and auto-version script
- Hardened: top-level permissions: {}, env bindings (no expression injection),
  persist-credentials only where needed for git push

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:09:00 +02:00
“mkczarkowski” fc64cea7d9 security: harden supply chain, add request timeout, and document threat model
- Pin GitHub Actions by full SHA to prevent tag-swapping attacks
- Add .npmrc with ignore-scripts and 7-day minimum-release-age quarantine
- Add 30s default request timeout for API calls without caller signal
- Remove unused `open` dependency to reduce attack surface
- Strip OpenAPI source URL from generated types header
- Add SECURITY.md documenting threat model (T1–T8), review history, and
  design decisions
- Add persist-credentials: false to checkout action

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:50:03 +02:00
“mkczarkowski” a68c743578 feat: serialize token refresh with file lock and pin CLI contracts via tests
Wrap the auth-guard refresh path in a proper-lockfile lock that re-reads
auth.json inside the critical section, so cooperating CLI processes (and
parallel in-process callers) racing on a near-expiry token can no longer
double-refresh — the late caller observes the rotated token and short-
circuits. Lock policy: 5 retries with 100–1000ms exponential backoff and
a 10s stale threshold, with auth_lock_timeout surfaced as a clean error
envelope on contention.

Add three test suites locking in invariants previously enforced only by
convention:
  - auth-guard-concurrency: in-process race, cross-process race via
    child_process.fork, stale-lock recovery, contention timeout
  - exit-codes: per-command exit-code matrix for auth login/--status
    /--logout, including the F1 fix (expired token in JSON mode → exit 3)
  - json-envelope: stdout envelope contract + leakage guard catching
    stray verbose markers, ANSI escapes, clack glyphs, multi-line output,
    and accidental email echo

Share auth-flow and @clack/prompts module mocks via tests/helpers/* so
mock.module registrations don't leak across test files in the same
bun test process; the mocks fall through to the real implementations
when no test state is configured, leaving auth-flow.test.ts untouched.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:04:20 +02:00
“mkczarkowski” b42b119050 feat:bootstrap the tool 2026-04-11 11:18:40 +02:00