Skip to content

feat: IPFS credential storage with preliminary credentials and gateway finalization#121

Open
sapience wants to merge 31 commits into
masterfrom
feat/content_ipfs
Open

feat: IPFS credential storage with preliminary credentials and gateway finalization#121
sapience wants to merge 31 commits into
masterfrom
feat/content_ipfs

Conversation

@sapience

@sapience sapience commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Moves credential content off-chain to IPFS and introduces a two-phase write flow: clients create preliminary credentials on-chain, a gateway uploads blobs and finalizes them into real credentials.

  • Add content_uri / content_size to credentials (inline content kept for migration; requires content OR content_uri)
  • Add preliminary_credentials table for pending credential creates/shares (original + copy in one row)
  • Add gateways role with finalize, blob auth, deletion queue, and stale-prelim cleanup actions
  • Add content_uris_to_delete queue; enqueue URIs on credential remove/rescind
  • Replace direct credential write actions (add_credential, edit_credential, share_credential, upsert_credential_as_inserter, create_credentials_by_dwg) with preliminary-first equivalents
  • Split credentials.inserter into inserter_type + inserter_id
  • Remove consumed_write_grants FKs to credentials and create_ag_by_dag_for_copy
  • Add 7 incremental migration SQLs under migrations/ipfs/
  • Generator: support @generator.ignore, fix multi-directive comment parsing, add array types to lexer

New gateway actions

  • get_prelim_credential_as_gateway / finalize_credentials_as_gateway
  • get_stale_prelim_as_gateway / delete_stale_prelim_as_gateway
  • blob_deletion_queue_as_gateway / confirm_blob_deleted_as_gateway
  • authorize_blob_fetch_as_gateway

Test plan

  • Run migrations/ipfs/17 on staging in order
  • Create credential via create_preliminary_credential → gateway finalizes → verify credentials row and blob access
  • Share via share_preliminary_credential → finalize copy + access grant
  • DWG flow via create_prelim_credentials_by_dwg
  • Remove/rescind credential → URI appears in content_uris_to_delete → gateway confirms deletion
  • Stale prelims listed and deleted by get_stale_prelim_as_gateway / delete_stale_prelim_as_gateway
  • Regenerate client bindings; confirm owner/gateway actions are excluded via @generator.ignore

Summary by CodeRabbit

  • Documentation
    • Documented the @generator.ignore directive for excluding actions from generated output.
  • New Features
    • Added a staged (“preliminary”) credential workflow with gateway-based finalization and stale cleanup, including a blob deletion queue and gateway-side blob authorization.
  • Refactor
    • Migrated credential storage to content_uri/content_size, split inserter identity (inserter_type/inserter_id), updated credential APIs/signatures, and removed older direct credential actions.
  • Chores
    • Improved generator parsing to honor @generator.ignore and added support for array type declarations.

sapience and others added 9 commits April 29, 2026 13:28
…_by_id_as_gateway and finalize_credentials_by_dwg_as_gateway actions

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…t flow.

Credentials:
- Rename content_manifest to content_uri; add content_size (positive when set).
- Replace inserter with inserter_type and inserter_id.

Preliminary credentials:
- Rename *content_manifest columns to *content_uri; add original/copy content_size.
- Store inserter_type and inserter_id (required) on preliminary rows.

Actions:
- Drop add_credential, edit_credential, upsert_credential_as_inserter; add
  create_preliminary_credential with id/URI/size checks and signature verify.
- Harden share and DWG preliminary paths: credential_id_in_use, validate_content_uri,
  content_uri_in_use, positive sizes, distinct original/copy URIs for DWG.
- Rename finalize_credentials_by_dwg_as_gateway to finalize_credentials_as_gateway;
  persist content_uri, content_size, inserter_type, inserter_id on finalize.
- Extend get_credentials*, get_credential_owned/shared, get_prelim_credential_as_gateway.

Schema:
- Remove consumed_write_grants foreign keys to credentials for original/copy ids.
- Add private helpers credential_id_in_use and content_uri_in_use.
@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 74e69843-6f36-4a84-b607-7953cbba15f0

📥 Commits

Reviewing files that changed from the base of the PR and between 8606c7b and 556605d.

📒 Files selected for processing (1)
  • schema.sql
📜 Recent review details
🧰 Additional context used
🪛 GitHub Actions: CI / 0_cspell.txt
schema.sql

[error] 776-776: cspell reported an unknown word: 'pkoch' at schema.sql:776:12.

🪛 GitHub Actions: CI / cspell
schema.sql

[error] 776-776: cspell found an unknown word 'pkoch' at schema.sql:776:12. Files checked: 29, Issues found: 1 in 1 file.

🔇 Additional comments (1)
schema.sql (1)

1144-1154: LGTM!


📝 Walkthrough

Walkthrough

The PR adds @generator.ignore support in the generator, expands lexer array-type recognition, and reworks IPFS credential storage around staged preliminaries, gateway finalization, URI-based content, and blob deletion queuing.

Changes

Generator @generator.ignore directive and array type support

Layer / File(s) Summary
@generator.ignore parsing and filtering
generator/src/parser/index.ts, generator/src/index.ts, generator/README.md
GeneratorComments gains ignore; comment parsing is refactored through applyGeneratorComment; the generate command filters out ignored AST entries; the README documents the new directive.
Array type lexer support
generator/src/parser/lexer.cjs
The TYPE token accepts array variants for the supported scalar type names.

IPFS credential staging and gateway flow

Layer / File(s) Summary
Schema and migration changes
schema.sql, migrations/ipfs/1.credentials_inserters.sql, migrations/ipfs/2.content_nullable.sql, migrations/ipfs/3.credentials_content_uri.sql, migrations/ipfs/4.preliminary_credentials.sql, migrations/ipfs/5.content_uris_to_delete.sql, migrations/ipfs/6.preliminary_credentials_indexes.sql, migrations/ipfs/7.credentials_content_check.sql, migrations/ipfs/8.drop_foreign_keys.sql, migrations/ipfs/9.drop_removed_actions.sql, project-words.txt
credentials switches to URI-based content fields and split inserter identity; new staging, deletion-queue, and gateway tables are added; supporting migrations add constraints, indexes, foreign-key drops, removed-action drops, and the spelling update.
Gateway guard and preliminary creation
schema.sql
gateway_or_error gates gateway actions; owner gateway actions are added; create_preliminary_credential stages credentials with content URI, size, and signature validation; credential read APIs return split inserter fields.
Deletion queueing and share staging
schema.sql
remove_credential and rescind_shared_credential enqueue content URIs before deletion, and share_preliminary_credential stages shared copies with URI, size, and signature checks.
Delegated-write staging and gateway finalization
schema.sql
create_prelim_credentials_by_dwg stages original and copy credentials with URI-based validation; gateway actions inspect prelims, finalize them into committed rows and grants, manage stale prelims and the blob deletion queue, and authorize blob fetches; get_credential_shared returns URI, size, and split inserter fields.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Poem

🐇 I hopped through the schema, so tidy and keen,
With prelims and gateways in between.
“Ignore” said the rabbit, “and generate less,”
While blobs wait in queues for their cleanup success.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: IPFS-based credential storage with preliminary credentials and gateway finalization.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/content_ipfs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sapience sapience changed the title Add preliminary IPFS credential flow feat: IPFS credential storage with preliminary credentials and gateway finalization Jun 22, 2026
@sapience sapience marked this pull request as ready for review June 22, 2026 13:57

@coderabbitai coderabbitai 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.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
generator/src/parser/index.ts (1)

82-102: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Accumulator lacks default values for interface fields.

The reduce initializer {} as GeneratorComments creates an empty object, but GeneratorComments declares required fields (ignore, notAuthorized, description, paramOptional, returnOptional). When no @generator.* comments are present, accessing generatorComments.ignore in index.ts will return undefined rather than false.

This works by accident because !undefined is truthy in the filter !x.generatorComments.ignore, but it's fragile and inconsistent with the interface contract.

♻️ Proposed fix: Initialize accumulator with default values
       }, {} as GeneratorComments);
+      }, {
+        ignore: false,
+        notAuthorized: false,
+        description: "",
+        paramOptional: [],
+        returnOptional: [],
+      } as GeneratorComments);
🤖 Prompt for 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.

In `@generator/src/parser/index.ts` around lines 82 - 102, The reduce function
initializes the accumulator with an empty object cast to GeneratorComments type,
which causes the interface fields (ignore, notAuthorized, description,
paramOptional, returnOptional) to be undefined when no generator comments are
present. Replace the empty object initializer `{} as GeneratorComments` with an
object that provides proper default values for all required fields in the
GeneratorComments interface, such as setting boolean fields to false and string
fields to empty strings or appropriate defaults, so that the interface contract
is properly maintained throughout the parsing logic.
schema.sql (1)

139-149: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add a migration to drop legacy consumed_write_grants credential FKs on upgraded databases.

Line 148 reflects the new no-FK table shape, but none of the migrations/ipfs/*.sql files drops pre-existing FK constraints. Upgraded environments can keep old constraints and block credential deletions/finalization flows.

Suggested follow-up migration
+-- migrations/ipfs/8.drop_consumed_write_grants_fks.sql
+ALTER TABLE consumed_write_grants
+  DROP CONSTRAINT IF EXISTS consumed_write_grants_original_credential_id_fkey;
+
+ALTER TABLE consumed_write_grants
+  DROP CONSTRAINT IF EXISTS consumed_write_grants_copy_credential_id_fkey;
🤖 Prompt for 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.

In `@schema.sql` around lines 139 - 149, The schema.sql shows the
consumed_write_grants table without foreign key constraints, but existing
upgraded databases retain legacy FK constraints from previous schema versions,
which blocks credential deletion and finalization flows. Create a new migration
file in the migrations/ipfs/ directory that drops the pre-existing foreign key
constraints on the consumed_write_grants table to ensure upgraded environments
match the new schema design and don't block credential operations.
🤖 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 `@generator/src/parser/lexer.cjs`:
- Line 16: The TYPE array in the lexer is missing array type variants for
BOOLEAN, BOOL, INT8, and NUMERIC types. Add BOOLEAN[], BOOL[], INT8[], and
NUMERIC[] to the TYPE array alongside the existing array types (TEXT[], UUID[],
INT[]) to ensure complete type coverage, even though these variants are not
currently used by the schema. This will prevent parsing failures if future
schema changes introduce these array types.

In `@migrations/ipfs/6.preliminary_credentials_indexes.sql`:
- Around line 1-4: The migration file is missing an index on the created_at
column of the preliminary_credentials table. The functions
get_stale_prelim_as_gateway and delete_stale_prelim_as_gateway perform filtering
based on the created_at column for identifying stale records, so without an
index on this column, these cleanup operations will degrade to full table scans
as the table grows. Add a CREATE INDEX statement for the created_at column on
the preliminary_credentials table to this migration file, following the same
naming pattern and format as the existing index definitions.

In `@schema.sql`:
- Around line 1135-1136: The delete_stale_prelim_as_gateway action is missing
the `@generator.ignore` directive, which other gateway/owner operations have for
consistency. Add the `@generator.ignore` directive to the action definition to
prevent it from leaking into generated client bindings, matching the pattern
used for other gateway operations in the schema.
- Around line 774-784: The delegated issuer enforcement validation is currently
commented out, which bypasses the security check that ensures credential issuers
are properly delegated. Uncomment the if statement that checks the
$the_same_issuer variable (currently on lines 782-784) to re-enable the error
that should be raised when the issuer is not a delegate of the delegated write
grant. This will restore the authorization control that validates issuer and
delegate alignment in the DWG flow.
- Around line 198-213: The gateway address handling is not canonicalized,
causing case-sensitivity issues where identical addresses with different casing
could be treated as separate entries or rejected incorrectly. In the
add_gateway_as_owner action, apply a canonicalization function (such as LOWER)
to the $address parameter when inserting into the gateways table. Apply the same
canonicalization function to the delete_gateway_as_owner action when deleting
from gateways. Finally, in the gateway_or_error action, apply the same
canonicalization function to `@caller` in the WHERE clause condition to ensure
consistent matching. This ensures all address comparisons use the same
normalized format regardless of input casing.

---

Outside diff comments:
In `@generator/src/parser/index.ts`:
- Around line 82-102: The reduce function initializes the accumulator with an
empty object cast to GeneratorComments type, which causes the interface fields
(ignore, notAuthorized, description, paramOptional, returnOptional) to be
undefined when no generator comments are present. Replace the empty object
initializer `{} as GeneratorComments` with an object that provides proper
default values for all required fields in the GeneratorComments interface, such
as setting boolean fields to false and string fields to empty strings or
appropriate defaults, so that the interface contract is properly maintained
throughout the parsing logic.

In `@schema.sql`:
- Around line 139-149: The schema.sql shows the consumed_write_grants table
without foreign key constraints, but existing upgraded databases retain legacy
FK constraints from previous schema versions, which blocks credential deletion
and finalization flows. Create a new migration file in the migrations/ipfs/
directory that drops the pre-existing foreign key constraints on the
consumed_write_grants table to ensure upgraded environments match the new schema
design and don't block credential operations.
🪄 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

Run ID: 866df3e5-4b28-44fd-abb9-2cfbd12cd764

📥 Commits

Reviewing files that changed from the base of the PR and between c28e0c2 and 0500be6.

⛔ Files ignored due to path filters (1)
  • generator/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • generator/README.md
  • generator/src/index.ts
  • generator/src/parser/index.ts
  • generator/src/parser/lexer.cjs
  • migrations/ipfs/1.credentials_inserters.sql
  • migrations/ipfs/2.content_nullable.sql
  • migrations/ipfs/3.credentials_content_uri.sql
  • migrations/ipfs/4.preliminary_credentials.sql
  • migrations/ipfs/5.content_uris_to_delete.sql
  • migrations/ipfs/6.preliminary_credentials_indexes.sql
  • migrations/ipfs/7.credentials_content_check.sql
  • schema.sql
📜 Review details
🧰 Additional context used
🪛 GitHub Actions: CI / 0_cspell.txt
schema.sql

[error] 775-775: cspell reported an unknown word: 'pkoch' (Unknown word).

🔇 Additional comments (10)
generator/src/parser/index.ts (2)

42-67: LGTM!


25-31: LGTM!

generator/src/index.ts (1)

22-24: LGTM!

generator/README.md (1)

49-49: LGTM!

migrations/ipfs/1.credentials_inserters.sql (1)

1-2: LGTM!

migrations/ipfs/2.content_nullable.sql (1)

1-1: LGTM!

migrations/ipfs/3.credentials_content_uri.sql (1)

1-4: LGTM!

migrations/ipfs/4.preliminary_credentials.sql (1)

1-24: LGTM!

migrations/ipfs/5.content_uris_to_delete.sql (1)

1-4: LGTM!

migrations/ipfs/7.credentials_content_check.sql (1)

1-1: LGTM!

Comment thread generator/src/parser/lexer.cjs Outdated
Comment thread migrations/ipfs/6.preliminary_credentials_indexes.sql
Comment thread schema.sql
Comment thread schema.sql
Comment on lines 774 to +784
-- Check the content creator (encryptor) of credentials is the issuer that user delegated to issue the credentials
-- Q: @pkoch i am not sure that they have to be the same. Do we restrict credential creators to delegates?
$the_same_issuer := false;
for $row in SELECT 1 FROM delegates d1 INNER JOIN delegates d2 ON d1.inserter_id = d2.inserter_id
WHERE d1.address = lower($issuer_auth_public_key) AND d2.address = lower($dwg_issuer_public_key) LIMIT 1 {
$the_same_issuer := true;
break;
}
if !$the_same_issuer {
error('credentials issuer must be an issuer of delegated write grant');
}
-- if !$the_same_issuer {
-- error('credentials issuer must be an issuer of delegated write grant');
-- }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Re-enable delegated issuer enforcement in DWG flow.

Lines 782-784 are commented out, so the computed $the_same_issuer check is never enforced. That weakens delegated-write authorization by not requiring issuer/delegate alignment.

Suggested fix
-    -- if !$the_same_issuer {
-    --     error('credentials issuer must be an issuer of delegated write grant');
-    -- }
+    if !$the_same_issuer {
+        error('credentials issuer must be an issuer of delegated write grant');
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
-- Check the content creator (encryptor) of credentials is the issuer that user delegated to issue the credentials
-- Q: @pkoch i am not sure that they have to be the same. Do we restrict credential creators to delegates?
$the_same_issuer := false;
for $row in SELECT 1 FROM delegates d1 INNER JOIN delegates d2 ON d1.inserter_id = d2.inserter_id
WHERE d1.address = lower($issuer_auth_public_key) AND d2.address = lower($dwg_issuer_public_key) LIMIT 1 {
$the_same_issuer := true;
break;
}
if !$the_same_issuer {
error('credentials issuer must be an issuer of delegated write grant');
}
-- if !$the_same_issuer {
-- error('credentials issuer must be an issuer of delegated write grant');
-- }
-- Check the content creator (encryptor) of credentials is the issuer that user delegated to issue the credentials
-- Q: `@pkoch` i am not sure that they have to be the same. Do we restrict credential creators to delegates?
$the_same_issuer := false;
for $row in SELECT 1 FROM delegates d1 INNER JOIN delegates d2 ON d1.inserter_id = d2.inserter_id
WHERE d1.address = lower($issuer_auth_public_key) AND d2.address = lower($dwg_issuer_public_key) LIMIT 1 {
$the_same_issuer := true;
break;
}
if !$the_same_issuer {
error('credentials issuer must be an issuer of delegated write grant');
}
🧰 Tools
🪛 GitHub Actions: CI / 0_cspell.txt

[error] 775-775: cspell reported an unknown word: 'pkoch' (Unknown word).

🤖 Prompt for 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.

In `@schema.sql` around lines 774 - 784, The delegated issuer enforcement
validation is currently commented out, which bypasses the security check that
ensures credential issuers are properly delegated. Uncomment the if statement
that checks the $the_same_issuer variable (currently on lines 782-784) to
re-enable the error that should be raised when the issuer is not a delegate of
the delegated write grant. This will restore the authorization control that
validates issuer and delegate alignment in the DWG flow.

Comment thread schema.sql
sapience and others added 3 commits June 22, 2026 17:19
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai 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.

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 `@migrations/ipfs/8.drop_foreign_keys.sql`:
- Around line 4-5: The cspell spell-checker is incorrectly flagging `fkey` in
the ALTER TABLE statements on lines 4 and 5 as an invalid word, even though it
is a valid SQL constraint naming convention. Suppress the spell-check on these
lines by adding a cspell directive above each line (such as a
cspell:disable-line comment) to allow the migrations to pass CI, or
alternatively add `fkey` to your project's cspell dictionary configuration file
so the term is recognized as valid across the codebase.
🪄 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

Run ID: 52449e3d-8e74-493a-813c-b2162a73a9cf

📥 Commits

Reviewing files that changed from the base of the PR and between 0500be6 and a766a89.

📒 Files selected for processing (5)
  • generator/src/parser/lexer.cjs
  • migrations/ipfs/6.preliminary_credentials_indexes.sql
  • migrations/ipfs/8.drop_foreign_keys.sql
  • migrations/ipfs/9.drop_removed_actions.sql
  • schema.sql
📜 Review details
🧰 Additional context used
🪛 GitHub Actions: CI / 0_cspell.txt
migrations/ipfs/8.drop_foreign_keys.sql

[error] 4-4: cspell found an unknown word: "fkey".


[error] 5-5: cspell found an unknown word: "fkey".

schema.sql

[error] 776-776: cspell found an unknown word: "pkoch".

🪛 GitHub Actions: CI / cspell
migrations/ipfs/8.drop_foreign_keys.sql

[error] 4-4: cspell reported unknown word 'fkey' (unknown word).


[error] 5-5: cspell reported unknown word 'fkey' (unknown word).

schema.sql

[error] 776-776: cspell reported unknown word 'pkoch' (unknown word).

🪛 SQLFluff (4.2.2)
migrations/ipfs/6.preliminary_credentials_indexes.sql

[error] 5-5: CREATE INDEX should use CONCURRENTLY to avoid locking the table during the build.

(PG01)

🔇 Additional comments (4)
generator/src/parser/lexer.cjs (1)

16-16: LGTM!

migrations/ipfs/6.preliminary_credentials_indexes.sql (1)

5-5: LGTM!

migrations/ipfs/9.drop_removed_actions.sql (1)

1-6: LGTM!

schema.sql (1)

90-90: LGTM!

Also applies to: 1136-1136

Comment on lines +4 to +5
ALTER TABLE consumed_write_grants DROP CONSTRAINT consumed_write_grants_original_credential_id_fkey;
ALTER TABLE consumed_write_grants DROP CONSTRAINT consumed_write_grants_copy_credential_id_fkey;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Fix CI spell-check failures on constraint identifiers.

Line 4 and Line 5 are valid SQL identifiers, but cspell is failing the pipeline on fkey. Suppress cspell on these lines (or add fkey to project dictionary) so migrations can merge.

Proposed minimal fix
+-- cspell:disable-next-line
 ALTER TABLE consumed_write_grants DROP CONSTRAINT consumed_write_grants_original_credential_id_fkey;
+-- cspell:disable-next-line
 ALTER TABLE consumed_write_grants DROP CONSTRAINT consumed_write_grants_copy_credential_id_fkey;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ALTER TABLE consumed_write_grants DROP CONSTRAINT consumed_write_grants_original_credential_id_fkey;
ALTER TABLE consumed_write_grants DROP CONSTRAINT consumed_write_grants_copy_credential_id_fkey;
-- cspell:disable-next-line
ALTER TABLE consumed_write_grants DROP CONSTRAINT consumed_write_grants_original_credential_id_fkey;
-- cspell:disable-next-line
ALTER TABLE consumed_write_grants DROP CONSTRAINT consumed_write_grants_copy_credential_id_fkey;
🧰 Tools
🪛 GitHub Actions: CI / 0_cspell.txt

[error] 4-4: cspell found an unknown word: "fkey".


[error] 5-5: cspell found an unknown word: "fkey".

🪛 GitHub Actions: CI / cspell

[error] 4-4: cspell reported unknown word 'fkey' (unknown word).


[error] 5-5: cspell reported unknown word 'fkey' (unknown word).

🤖 Prompt for 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.

In `@migrations/ipfs/8.drop_foreign_keys.sql` around lines 4 - 5, The cspell
spell-checker is incorrectly flagging `fkey` in the ALTER TABLE statements on
lines 4 and 5 as an invalid word, even though it is a valid SQL constraint
naming convention. Suppress the spell-check on these lines by adding a cspell
directive above each line (such as a cspell:disable-line comment) to allow the
migrations to pass CI, or alternatively add `fkey` to your project's cspell
dictionary configuration file so the term is recognized as valid across the
codebase.

Source: Pipeline failures

sapience added 3 commits June 23, 2026 13:58
Prevents orphaned IPFS pins when the gateway pinned blobs but finalize never completed.
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