Skip to content

Document licensing, security, and SumUp; improve local precommit runs - #1918

Merged
stefan-burke merged 15 commits into
mainfrom
docs/update-project-documentation
Jul 25, 2026
Merged

Document licensing, security, and SumUp; improve local precommit runs#1918
stefan-burke merged 15 commits into
mainfrom
docs/update-project-documentation

Conversation

@stefan-burke

@stefan-burke stefan-burke commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

  • add the full GNU Affero General Public License v3 text and identify the project as AGPL-3.0-only
  • correct the encryption, password hashing, recovery, keyed-role, and API-key documentation
  • add SumUp to the payment documentation and explain how unsigned SumUp webhooks are validated
  • record a follow-up to recover paid SumUp checkouts through the shared payment processor when both the webhook and redirect are lost
  • set sensible local and CI test-worker defaults while preserving valid explicit DENO_JOBS overrides
  • prevent concurrent standard and mutation precommit gates with one process-owned advisory lock per operating-system user
  • release the standard precommit lock before the optional push prompt

Why

The documentation now matches the software people run. Local precommit gates also avoid competing for the same machine without PID files, stale-lock cleanup, cross-user permission conflicts, or platform-specific process probes.

Testing

  • GitHub Test workflow on 633305aa: passed lint, typecheck, duplication, edge build, and the full test suite with 100% coverage
  • nix develop -c deno task test:files test/scripts/lock-file.test.ts test/scripts/precommit/lock.test.ts test/scripts/precommit/run-order.test.ts test/scripts/workers.test.ts test/lib/test-groups.test.ts (46 passed)
  • focused deno check and Biome checks for the final precommit source and test files
  • targeted coverage for scripts/lock-file.ts, scripts/precommit/lock.ts, and scripts/precommit/run-order.ts (100% branches and lines)

The local all-in-one precommit command was intentionally skipped at the maintainer request. The equivalent GitHub workflow passed every gate.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds the AGPL license, updates security and payment documentation, and adds adaptive Deno worker configuration plus cross-process precommit locking with ordering and contention tests.

Changes

Documentation and licensing

Layer / File(s) Summary
License, security, and payment documentation
LICENSE, README.md, src/docs/crypto.ts, src/docs/payments.ts, src/doc.ts, TODO.md
Adds the AGPL v3 license and updates documented hashing, encryption, license identifiers, SumUp support, and planned SumUp checkout recovery.

Precommit coordination

Layer / File(s) Summary
Worker configuration
scripts/workers.ts, test/scripts/workers.test.ts
Validates DENO_JOBS, derives CI and capped local defaults, and tests valid, invalid, CI, and local cases.
Precommit lock and execution ordering
scripts/lock-file.ts, scripts/precommit/run-order.ts, test/scripts/lock-file.test.ts, test/scripts/precommit/run-order.test.ts
Awaits lock release, separates CI and local check execution, and tests lock contention, recovery, and event ordering.
Runner integration
scripts/precommit/runner.ts
Applies resolved worker settings, adds a temporary-file precommit lock, extracts step execution, and routes checks and pushing through the shared ordering helper.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Runner as precommit runner
  participant Order as runChecksBeforePush
  participant Lock as withPrecommitLock
  participant File as withFileLock

  Runner->>Runner: resolveDenoJobs()
  Runner->>Order: run checks and push
  Order->>Lock: run local checks under lock
  Lock->>File: acquire temporary lock
  File-->>Lock: execute checks
  File-->>Lock: await unlock
  Lock-->>Order: checks complete
  Order->>Runner: push checked-in changes
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main documentation, SumUp, and local precommit changes in the pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/update-project-documentation
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch docs/update-project-documentation

Comment @coderabbitai help to get the list of available commands.

@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: 5c4194e7a3

ℹ️ 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/docs/payments.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 406-408: Run the repository’s `deno task precommit` command for
this README-only change, then resolve any reported failures before merging while
preserving the license text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1cd01545-dda1-467e-bd1e-72f7f9b8ac77

📥 Commits

Reviewing files that changed from the base of the PR and between 9c70f03 and 5c4194e.

📒 Files selected for processing (4)
  • LICENSE
  • README.md
  • src/docs/crypto.ts
  • src/docs/payments.ts

Comment thread README.md
@stefan-burke stefan-burke changed the title Correct project documentation and add license text Correct project documentation, add license text, and record SumUp follow-ups Jul 25, 2026

@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: 4475f3d58e

ℹ️ 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 test/scripts/workers.test.ts Outdated
Comment thread scripts/precommit/runner.ts Outdated

@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: 153916decf

ℹ️ 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 test/scripts/precommit/lock.test.ts Outdated
Comment thread scripts/precommit/lock.ts Outdated
Comment thread scripts/precommit/lock.ts Outdated
Comment thread TODO.md Outdated
Comment thread test/scripts/precommit/lock.test.ts Outdated
Comment thread README.md Outdated

@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: 1f7a198b20

ℹ️ 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 scripts/precommit/lock.ts Outdated
Comment thread scripts/precommit/runner.ts Outdated
- lock.ts: make lock path injectable so tests stay off the live
  PRECOMMIT_LOCK_PATH during test:coverage runs
- lock.ts: write PID via single writeTextFileSync({createNew:true}) —
  atomic create+write removes the empty-file window the open-then-write
  sequence left
- lock.ts: document the macOS/Darwin signal-0 fallback (Deno.kill with
  0 as unknown as Deno.Signal) — Deno's runtime honours it for existence
  checks even though its type doesn't include numeric 0
- lock.ts: extract removeIfExistsSync to scripts/not-found.ts and use it
  for release/stealFromDeadHolder — kills the jscpd duplicates the
  refactor surfaced within lock.ts and cross-file with specs/run.ts and
  stripe-mock/install.ts
- lock.test.ts: unique per-run temp lock path so tests never collide with
  a real precommit run; spawn a process that exits immediately for a
  deterministic dead PID instead of guessing 999999 isn't in use
- workers.ts: extract resolveDenoJobs(hardwareConcurrency, ci, env) so the
  DENO_JOBS env-setting behaviour is directly testable without spawning
  precommit; runner.ts calls it and only sets DENO_JOBS when it returns
  a value (explicit operator override wins)
- workers.test.ts: drop the duplicated parseWorkerCount tests (they
  already live in test-groups.test.ts); add resolveDenoJobs coverage
- TODO.md: fix the inaccurate redirect description — the redirect path
  calls retrieveSession -> classifySessionIntent -> completePaidBooking,
  not retrieveSession -> finalizeSessionIfUnresolved (that's replaySuccess,
  the already-ledgered path)
- README.md: say 'keyed role (owner, manager, or agent)' rather than
  'keyed owner' — all three keyed roles receive a wrapped data key, so
  any of them can recover the protected data, not just owners
- test-groups.test.ts: cover the new removeIfExistsSync helper

Co-Authored-By: Codex <noreply@github.com>

@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: d561fa6468

ℹ️ 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 TODO.md Outdated
Comment thread scripts/precommit/lock.ts Outdated
Comment thread scripts/precommit/lock.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/precommit/lock.ts`:
- Line 1: Make the polling delay injectable in acquirePrecommitLock and
pollOnce, defaulting to POLL_INTERVAL_MS while passing the configured value into
pollOnce’s setTimeout. Update the “waits…” test to use withVirtualBackoff or an
injected near-zero interval, removing its dependency on real-time sleeps.

In `@scripts/precommit/runner.ts`:
- Around line 125-147: Remove the unreachable !lock.acquired branch from
withLock, including its logging and exit behavior, since acquirePrecommitLock is
invoked with its default waiting behavior. Preserve the existing task execution
and lock.release cleanup flow; only add an explicit no-wait option if withLock
is intentionally extended to support it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 529b57ee-5ce3-42b4-afc2-33a6e3e9b6d1

📥 Commits

Reviewing files that changed from the base of the PR and between 5c4194e and d561fa6.

📒 Files selected for processing (10)
  • README.md
  • TODO.md
  • scripts/not-found.ts
  • scripts/precommit/lock.ts
  • scripts/precommit/runner.ts
  • scripts/workers.ts
  • src/docs/payments.ts
  • test/lib/test-groups.test.ts
  • test/scripts/precommit/lock.test.ts
  • test/scripts/workers.test.ts

Comment thread scripts/precommit/lock.ts Outdated
Comment thread scripts/precommit/runner.ts Outdated
@stefan-burke stefan-burke changed the title Correct project documentation, add license text, and record SumUp follow-ups Document licensing, security, and SumUp; improve local precommit runs Jul 25, 2026

@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: f4bf464ce5

ℹ️ 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 README.md Outdated
Comment thread test/scripts/precommit/lock.test.ts Outdated
Comment thread scripts/workers.ts Outdated

@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: ae7a97c065

ℹ️ 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 scripts/precommit/lock.ts Outdated
Comment thread scripts/precommit/runner.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/scripts/lock-file.test.ts`:
- Around line 68-122: Add a regression test alongside the existing withFileLock
tests that stubs the opened file’s unlock method, blocks it with a deferred
promise, and verifies the withFileLock promise remains unsettled and the file is
not closed before releasing that promise. Reuse the existing Deno.open stubbing
and lock-file test utilities, then release the deferred unlock and assert the
operation completes and cleanup occurs.
- Around line 8-11: Update LOCK_PATH to use the platform-aware tmpdir() helper
instead of the hardcoded "/tmp" fallback, and import tmpdir() following the
existing pattern in lock.ts. Preserve the TMPDIR override behavior if
applicable.

In `@test/scripts/precommit/run-order.test.ts`:
- Around line 5-53: Add a rejection-path test for runChecksBeforePush where the
checks callback fails; assert the returned promise rejects with that error and
verify the push callback is never invoked, while preserving the existing
successful ordering and CI coverage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b9043bd7-5432-49d5-a5f6-6c6a540f4e8e

📥 Commits

Reviewing files that changed from the base of the PR and between d561fa6 and 8a574ed.

📒 Files selected for processing (11)
  • README.md
  • TODO.md
  • scripts/lock-file.ts
  • scripts/precommit/run-order.ts
  • scripts/precommit/runner.ts
  • scripts/workers.ts
  • src/doc.ts
  • src/docs/payments.ts
  • test/scripts/lock-file.test.ts
  • test/scripts/precommit/run-order.test.ts
  • test/scripts/workers.test.ts

Comment thread test/scripts/lock-file.test.ts
Comment thread test/scripts/lock-file.test.ts
Comment thread test/scripts/precommit/run-order.test.ts
@stefan-burke
stefan-burke added this pull request to the merge queue Jul 25, 2026
Merged via the queue into main with commit 67c03d8 Jul 25, 2026
3 checks passed
@stefan-burke
stefan-burke deleted the docs/update-project-documentation branch July 25, 2026 17:21
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