Skip to content

Lovable sync 1785438562 - #52

Open
criptogus wants to merge 11 commits into
mainfrom
lovable-sync-1785438562
Open

Lovable sync 1785438562#52
criptogus wants to merge 11 commits into
mainfrom
lovable-sync-1785438562

Conversation

@criptogus

Copy link
Copy Markdown
Owner

What does this PR add?

Type

  • New package (skill / playbook / soul / guardrail)
  • Improvement to an existing package (bumped version)
  • Platform code or docs

Checklist (for content PRs)

  • Filename matches slug and the type's folder
  • At least 2 worked examples (skills) — realistic input + exact expected output
  • Original work, public-domain, or properly attributed; no secrets / PII
  • bun run validate:content passes locally
  • I've read CONTRIBUTING.md and agree to license under Apache-2.0 (code) / CC-BY-SA-4.0 (content)

Notes for reviewers

lovable-dev Bot and others added 11 commits July 30, 2026 19:04
Co-authored-by: criptogus <128640021+criptogus@users.noreply.github.com>
Co-authored-by: criptogus <128640021+criptogus@users.noreply.github.com>
Co-authored-by: criptogus <128640021+criptogus@users.noreply.github.com>
Co-authored-by: criptogus <128640021+criptogus@users.noreply.github.com>
Co-authored-by: criptogus <128640021+criptogus@users.noreply.github.com>
Co-authored-by: criptogus <128640021+criptogus@users.noreply.github.com>
Co-authored-by: criptogus <128640021+criptogus@users.noreply.github.com>
Co-authored-by: criptogus <128640021+criptogus@users.noreply.github.com>
Co-authored-by: criptogus <128640021+criptogus@users.noreply.github.com>
Co-authored-by: criptogus <128640021+criptogus@users.noreply.github.com>
X-Lovable-Edit-ID: edt-ecdb1824-a252-4aa7-970c-ac6e54d10c25
Co-authored-by: criptogus <128640021+criptogus@users.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: 97c515c1c5

ℹ️ 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/lib/version.ts
*/

export const PLATFORM_VERSION = "0.1.37" as const;
export const PLATFORM_VERSION = "0.1.34" as const;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the monotonically increasing platform version

Deploying this commit on its parent rolls the advertised release backward from 0.1.37 to 0.1.34 and removes versions 0.1.35–0.1.37 from the changelog. Because the footer and /api/public/version source this constant, users and integrations will observe a stale downgrade despite receiving a new user-facing route; retain the existing history and advance the version instead.

Useful? React with 👍 / 👎.

Comment on lines +21 to +26
const url = process.env.SUPABASE_URL;
const key = process.env.SUPABASE_PUBLISHABLE_KEY;
if (!url || !key) return [];

const supabase = createClient<Database>(url, key, {
auth: { storage: undefined, persistSession: false, autoRefreshToken: false },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Read the public release log through an authorized path

In the deployed schema, supabase/migrations/20260706140127_10a5d0b0-7709-4139-9d8b-608b402a2e2d.sql drops anonymous access and permits package_releases reads only to authenticated owners or admins. This client has only the publishable key and no user session, so RLS returns no rows even when signed releases exist and the new trust-center page always shows its empty state; use a public-safe view/RPC or a server-authorized query that explicitly filters to published packages.

Useful? React with 👍 / 👎.

Comment thread src/routes/security.tsx
const hash = crypto.createHash('sha256').update(pkg).digest();
const sig = Buffer.from(process.env.SIG_BASE64, 'base64');
const pub = Buffer.from(process.env.PUB_BASE64, 'base64');
console.log('valid:', nacl.sign.detached.verify(hash, sig, pub));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Exit unsuccessfully when direct signature verification fails

When users copy this direct verifier into CI or a deployment gate, an invalid signature merely prints valid: false; node -e still exits with status 0. That contradicts the page's statement that tampering produces a non-zero exit and allows a modified package to pass any check based on process status, so explicitly exit non-zero when verification returns false.

Useful? React with 👍 / 👎.

Comment thread src/routes/security.tsx
Comment on lines +118 to +122
const pkg = fs.readFileSync('pkg.yaml');
const hash = crypto.createHash('sha256').update(pkg).digest();
const sig = Buffer.from(process.env.SIG_BASE64, 'base64');
const pub = Buffer.from(process.env.PUB_BASE64, 'base64');
console.log('valid:', nacl.sign.detached.verify(hash, sig, pub));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Verify the same hash representation that releases sign

For signatures produced by this repository, src/lib/trust/signing.ts signs Buffer.from(content_hash), i.e. the 64 ASCII hexadecimal bytes of the canonicalized package hash. This example instead verifies the 32 raw digest bytes of the YAML file, so even a legitimate release signature will report invalid; recompute the canonical content hash and verify its hexadecimal string bytes, matching verifyRelease.

Useful? React with 👍 / 👎.

@criptogus criptogus left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Análise: positiva / segura para merge (o GitHub não permite marcar "Approve" na própria PR, então fica registrado como comentário).

Sync do Lovable com escopo restrito a frontend/site: nova página /security (trust center), server function pública de release log e refinos visuais em componentes da home.

Pontos verificados:

  • getPublicReleaseLog usa apenas SUPABASE_PUBLISHABLE_KEY (chave pública), sem sessão persistida, leitura limitada a 20 linhas de package_releases e assinatura truncada (signature_preview) — nenhum segredo ou dado sensível exposto.
  • Nenhuma mudança em lógica de trust scoring, assinatura de releases, banco ou políticas RLS — apenas exibição.
  • Sem alterações em CI ou dependências de runtime relevantes.

Observação menor (não bloqueante): em security.functions.ts, row.signature.slice(...) lançaria erro se signature vier nula; um row.signature ?? "" deixaria o loader mais resiliente.


Generated by Claude Code

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