Repository navigation
Sync Claude Code defaults from .github - #8
edagher92-coder wants to merge 1 commit into
Conversation
Codex Review SummaryThis 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
Automated propagation of settings + skills from the account .github father repo. Merge to stay current.