Repository navigation
Sync Claude Code defaults from .github - #8
edagher92-coder wants to merge 1 commit into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d96a75d15
ℹ️ 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".
| **Clients (each PC, one command):** | ||
| ```powershell | ||
| .\bootstrap.ps1 -OllamaHub http://<your-machine>.<your-tailnet>.ts.net:11434 | ||
| .\bootstrap.ps1 -OllamaHub http://elzydlab.tail76b098.ts.net:11434 |
There was a problem hiding this comment.
Keep private infrastructure identifiers out of this repo
This synchronization reverses the prior privacy scrub (2667faa) by committing the real tailnet hostname; the same diff also restores tailnet IPs, a phone number, and Meta account/app/business identifiers. If this repository is published—as the scrub commit explicitly anticipated—those details become available in clones and forks, exposing internal infrastructure and personal/business identifiers. Restore placeholders here and keep environment-specific values in untracked local configuration.
Useful? React with 👍 / 👎.
55af73b to
e99bb74
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e99bb74e36
ℹ️ 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".
| -- Revoke direct execution from public roles | ||
| revoke execute on function private.is_team_member(bigint) from PUBLIC, anon, authenticated, service_role; |
There was a problem hiding this comment.
Preserve helper execution privileges for roles using the policy
When this example is applied to an RLS-protected table queried as authenticated, revoking EXECUTE from both PUBLIC and authenticated prevents the subsequent policy from calling private.is_team_member, causing queries to fail with a function-permission error instead of filtering orders. SECURITY DEFINER changes privileges inside the function; it does not authorize callers to invoke it. PostgreSQL documents that policy expressions execute “with the privileges of the user running the query.” (Row Security Policies) Retain or explicitly grant EXECUTE for roles that use this policy, while keeping the helper schema outside the exposed API schemas.
Useful? React with 👍 / 👎.
| ```typescript | ||
| const cache = createCache({ | ||
| ttl: 60, | ||
| storage: { type: 'memory' }, |
There was a problem hiding this comment.
Enable reference invalidation in the cache configuration
When this reference-based invalidation example is followed, cache.invalidateAll('user:123') leaves the cached entries untouched because memory storage disables invalidation by default. Consequently, updating a user and running the illustrated invalidation still serves the old data until the 60-second TTL expires. The library documentation explicitly requires enabling invalidation in storage settings, and its memory implementation returns without removing entries when that option is disabled. Set storage.options.invalidation: true in this example.
Useful? React with 👍 / 👎.
|
|
||
| async function* toUpperCase(source: AsyncIterable<Buffer>): AsyncGenerator<string> { | ||
| for await (const chunk of source) { | ||
| yield chunk.toString().toUpperCase(); |
There was a problem hiding this comment.
Decode UTF-8 across stream chunk boundaries
For UTF-8 input containing a multibyte character split across two file-stream chunks, decoding each Buffer separately replaces the partial character with replacement characters and silently corrupts the output. Running this transform with the bytes of café split inside é produces CAF�� rather than CAFÉ; the later CSV enrichment and line-parsing examples repeat the same decoding pattern. Configure the input streams with encoding: 'utf8' and consume strings, or retain a StringDecoder across chunks, so incomplete characters survive until the next chunk.
Useful? React with 👍 / 👎.
| // Fastify automatically handles graceful shutdown | ||
| // Just register your cleanup in onClose hooks |
There was a problem hiding this comment.
Register a shutdown handler in the standalone Fastify example
When the illustrated application is started directly with Node and receives SIGTERM or SIGINT, Fastify does not automatically call app.close(): the process terminates without draining in-flight requests or running the database/cache cleanup hooks. The Fastify hook documentation states that onClose is triggered when fastify.close() is invoked. Automatic signal handling is supplied separately by fastify-cli, which explicitly registers closeWithGrace and calls fastify.close(), but this example does not use that CLI. Register an equivalent handler here rather than instructing consumers that the hooks alone provide graceful shutdown.
Useful? React with 👍 / 👎.
e99bb74 to
057fc67
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 057fc67755
ℹ️ 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".
| await cache.invalidate('getUser', '123'); | ||
|
|
There was a problem hiding this comment.
Use clear to invalidate a cache entry by its key
In the manual-invalidation example, cache.invalidate('getUser', '123') does not remove the entry cached by cache.getUser('123'): invalidate interprets its second argument as a reference, not an entry key, and the illustrated getUser definition does not register references. Consumers following this pattern therefore continue serving the cached user after an update. Use cache.clear('getUser', '123') for key-based removal, as distinguished in the library implementation.
Useful? React with 👍 / 👎.
| }); | ||
|
|
||
| cache.define('getUserPosts', { | ||
| references: (args, key, result) => [`user:${args[0]}`], |
There was a problem hiding this comment.
Build the posts reference from the complete user ID
Even after enabling reference invalidation in storage, this callback registers posts under the wrong reference: the library passes the original argument directly to references, not an array of arguments (implementation). Thus cache.getUserPosts('123') registers user:1, and the illustrated invalidateAll('user:123') leaves those posts cached. Interpolate args itself so the user and posts entries share the same reference.
Useful? React with 👍 / 👎.
| Alternative: use a single statement to update atomically: | ||
|
|
||
| ```sql | ||
| -- Single statement acquires all locks atomically |
There was a problem hiding this comment.
Preserve ordered locking in the single-statement alternative
When concurrent transactions touch overlapping accounts in different scan orders, this alternative can still deadlock: PostgreSQL acquires row locks as the UPDATE processes rows, not atomically for the entire statement, and WHERE id IN (1, 2) does not impose a locking order. For example, this statement can lock account 2 first while the preceding ordered-locking pattern holds account 1, leaving each transaction waiting for the other. Presenting it as a replacement for explicit ordered locking removes the protection this rule is meant to provide. Retain the ordered SELECT ... FOR UPDATE before the UPDATE; the PostgreSQL deadlock documentation requires consistent lock ordering or transaction retries.
Useful? React with 👍 / 👎.
| pattern-sanitizers: | ||
| - pattern: strconv.Atoi($X) | ||
| - pattern: strconv.ParseInt($X, ...) | ||
| - pattern: filepath.Clean($X) |
There was a problem hiding this comment.
Keep filepath.Clean output tainted in the Go traversal rule
When this rule scans a handler that passes filepath.Clean(req.URL.Query().Get("path")) to os.ReadFile, the sanitizer declaration suppresses the traversal finding even though inputs such as ../../etc/passwd remain dangerous. filepath.Clean only normalizes a path lexically; it does not enforce containment or reject leading parent-directory components. Because Semgrep treats sanitizer matches as untainted, this creates a false negative in the path-traversal sinks explicitly included above. Remove filepath.Clean from the sanitizers and only suppress flows with a verified containment check.
Useful? React with 👍 / 👎.
057fc67 to
4487b04
Compare
3584484 to
dfcb77b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfcb77b80f
ℹ️ 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".
| -- Option 2: Deallocate after use in transaction mode | ||
| prepare get_user as select * from users where id = $1; | ||
| execute get_user(123); | ||
| deallocate get_user; |
There was a problem hiding this comment.
Keep preparation and execution in the same transaction
When these statements are executed separately in autocommit mode through a transaction pooler, the connection can be returned to the pool immediately after PREPARE, so EXECUTE can still reach a different backend and fail with “prepared statement does not exist.” Adding DEALLOCATE afterward does not prevent the failure demonstrated in the preceding incorrect example. PgBouncer documents that a server connection is assigned “only during a transaction.” Wrap the entire prepare/execute/deallocate sequence in an explicit transaction, or remove this option in favor of unnamed statements or session pooling.
Useful? React with 👍 / 👎.
| const focusableElements = modal.querySelectorAll( | ||
| 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' | ||
| ); | ||
| const firstElement = focusableElements[0]; | ||
| const lastElement = focusableElements[focusableElements.length - 1]; |
There was a problem hiding this comment.
Exclude non-tabbable controls from modal focus boundaries
When a custom modal ends with a disabled submit button, this selector still assigns that button to lastElement, even though keyboard focus cannot reach it. Pressing Tab from the last enabled control therefore misses the wraparound condition and moves focus outside the modal; Shift+Tab from the first control instead attempts to focus the disabled button and goes nowhere. This defeats the copy-paste pattern linked from the main accessibility skill and the W3C modal keyboard interaction requirements. Derive the boundaries from actually tabbable, enabled, visible elements, or use a native modal dialog.
Useful? React with 👍 / 👎.
dfcb77b to
4f1c707
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f1c7077ec
ℹ️ 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".
| select 1 from pg_constraint | ||
| where conname = 'check_age_positive' |
There was a problem hiding this comment.
Scope constraint-existence checks to the target table
If another table or schema already has a constraint named check_age_positive, this check silently skips adding the constraint to users, leaving invalid ages accepted while the migration reports success. The foreign-key example below has the same problem. PostgreSQL explicitly documents that conname is not necessarily unique. Include the target table's conrelid in both existence predicates, as the preceding unique-constraint example already does.
Useful? React with 👍 / 👎.
| log_text, log_error = fetch_run_log(run_id, repo_root) | ||
| if not log_error: | ||
| return log_text, "", "ok" |
There was a problem hiding this comment.
Retrieve job-specific logs before falling back to the full run
When a completed workflow contains multiple failing jobs, fetch_check_log returns the entire run log for every check and ignores the extracted job_id. Since extract_failure_snippet selects the last failure marker, unrelated checks receive the same failure snippet; a mocked lint/build run reproduces the build error being reported for both checks. In this script, job-specific retrieval only happens when the full run is still pending. Prefer job-scoped logs whenever a job ID is available: the GitHub CLI documentation describes --job as “View a specific job ID from a run” and demonstrates gh run view --log --job 456789.
Useful? React with 👍 / 👎.
| -- work_mem * max_connections should not exceed 25% of RAM | ||
| alter system set work_mem = '8MB'; -- 8MB * 100 = 800MB max |
There was a problem hiding this comment.
Account for per-operation memory when sizing work_mem
For concurrent queries containing multiple sorts or hash joins, the stated 800MB max is not a memory ceiling, so following this calculation can exhaust the example's 4GB server despite satisfying the proposed 25% rule. PostgreSQL allocates work_mem per query operation, applies an additional hash_mem_multiplier to hash tables, and gives parallel workers their own allowances, as explained in its resource-consumption documentation. Replace the claimed maximum with a workload-dependent estimate that accounts for concurrently active operations, hash memory, and parallel workers rather than treating each connection as one allocation.
Useful? React with 👍 / 👎.
4f1c707 to
87ee0c9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87ee0c955d
ℹ️ 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".
| await server.close(); | ||
| await db.end(); |
There was a problem hiding this comment.
Await the HTTP server's close callback before closing the database
When this Kubernetes shutdown pattern is used with the node:http server demonstrated above and a request is still running after the five-second pause, await server.close() does not wait for that request: close() returns the server, not a promise. Consequently, db.end() runs while handlers may still need the database, and the shutdown callback can finish before responses drain. A local reproduction produced db.end called before request finished and server closed. Wrap the close callback in a promise, as the earlier HTTP shutdown example already does, before releasing dependent resources.
Useful? React with 👍 / 👎.
Automated propagation of settings + skills from the account .github father repo. Merge to stay current.