Skip to content

Publish Content database intake capabilities - #2866

Merged
3mdistal merged 9 commits into
mainfrom
codex/content-delegated-intake
Aug 14, 2026
Merged

Publish Content database intake capabilities#2866
3mdistal merged 9 commits into
mainfrom
codex/content-delegated-intake

Conversation

@3mdistal

@3mdistal 3mdistal commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Problem

Workspace agents can discover authenticated write capabilities from sibling apps, but Content did not publish enough information for a coordinating agent to find and delegate structured database intake reliably. Database discovery returned only titles, omitted the user-authored description that explains what a database is for, and did not expose a safe schema-read capability. Existing Content mutations were also absent from authenticated capability discovery.

That left Dispatch choosing between guesswork and app-specific routing knowledge. A request such as filing a design ask could be mistaken for visual Design work even when workspace instructions name an existing Content intake database.

Approach

Keep Actions as the single source of truth and make delegation the default. Content publishes a deliberately small authenticated surface:

  • two access-scoped reads can be called directly to discover an ordinary database and inspect its schema;
  • existing create and correction Actions are advertised without input schemas as message-only capabilities.

The calling agent learns that Content can own the job, then sends the objective to the Content agent. Content still interprets its live schema, selects local Actions, validates values, and performs authorized writes. Dispatch remains generic; this PR adds no hardcoded database-to-app mapping, and genuine visual design requests still route to Design.

What changed

  • Extended list-content-databases to search live titles and user-authored descriptions and return stable database, document, and space IDs.
  • Added bounded, deterministic pagination with explicit totalItems, hasMore, and nextOffset metadata. Source-chain exclusions are resolved before the SQL limit, and the existing source picker exhausts every page through the same Action.
  • Added exact database ID, document ID, title, and space filters. Exact resource resolution fails loudly when missing or ambiguous, stops after two visible matches, and rejects whitespace-only titles.
  • Excluded trashed, hidden, deleted, inaccessible, and system-role databases from external discovery.
  • Added describe-content-database, a schema-only read that returns live database metadata, views, context, and properties without returning database rows. The full get-content-database Action remains app-local.
  • Advertised form submission, row creation, sparse document updates, and property updates as authenticated, consequential, message-only capabilities. Their schemas are not projected across Agent-to-Agent discovery.
  • Limited the Content connector catalog to the two bounded reads and added joined Content/Core/Dispatch coverage proving structured intake remains generic while visual design still selects Design.
  • Rendered paginated source-discovery failures as an explicit retryable error in both source pickers instead of presenting an unreadable list as empty.
  • Recorded the new schema reader in the generated Content parity matrix.

Safety and operations

Direct reads reuse Content access checks. The schema reader first resolves through the same access-scoped, system-excluding discovery path. Direct writes remain impossible: every mutation is delegated to the receiving Content agent and continues through its existing validation and assertAccess boundaries.

There are no migrations, backfills, production data writes, credential changes, or permission changes. Rollback is a code revert. Deployment and the real Slack acceptance story remain outside this PR and will use the existing Dispatch canary after merge.

Verification

  • Nine focused Vitest files pass: 65 tests covering access-scoped and paginated database discovery, exact and ambiguous resolution, source-picker pagination, system and inaccessible records, schema-only output, capability projection, generic Dispatch routing, form submission, correction identity, and sparse document updates.
  • Six source-picker and database UI suites pass: 109 tests at the Content package boundary.
  • The full deterministic Content parity lane passes: 14 files and 115 tests, including database lifecycle and the generated matrix.
  • The normal Content TypeScript check passes.
  • All 53 repository guards pass.
  • Bounded independent review caught disclosure, boundedness, schema-overread, error-coercion, and source-picker truncation edges. The repaired boundaries now keep ordinary discovery bounded and paginated in SQL, stop exact ambiguity after two visible matches, read schema metadata directly, preserve operational failures, exclude hidden resources conjunctively, exhaust pages in the existing picker, and distinguish failed reads from genuinely empty lists.

The deployed real-Slack story is intentionally pending. It requires Alice-authored messages through Computer Use in test-content-app, followed by Content record and source-thread read-back after this PR is merged and deployed.

Review focus

  • Does the two-read catalog provide enough deterministic discovery without flooding caller context?
  • Does describe-content-database stay safely narrower than the full app-local database reader?
  • Are system, inaccessible, missing, ambiguous, paginated, and unreadable database states handled at the correct boundary?
  • Do schema-less write capabilities preserve Content ownership of interpretation and mutation?

Follow-up

After merge and deployment, run the frozen Alice-authored Slack intake/correction acceptance story under the existing canary. That operational proof is required before the durable task closes; it is not implementation scope for this PR.

content_product_impact:
  lane: contract_fulfillment
  features:
    - content.feature.collect-structured-input
  capabilities:
    - content.object.database
    - content.agent.action-parity
  record_change: none
  proof:
    - 65 focused Content, A2A capability, Dispatch routing, intake, correction, and pagination tests pass
    - 109 source-picker and database UI tests pass at the Content package boundary
    - the full deterministic Content parity lane passes 115 tests and the normal Content typecheck passes
    - all 53 repository guards pass
    - bounded independent review drove repairs at the material capability and truthful-state boundaries
  rationale: This fulfills the accepted Content contract by making live database purpose and schema discoverable while keeping every write delegated to the Content agent through existing Actions and access controls.

@netlify

This comment has been minimized.

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

builder-io-integration[bot]

This comment was marked as outdated.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

builder-io-integration[bot]

This comment was marked as outdated.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

builder-io-integration[bot]

This comment was marked as outdated.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

builder-io-integration[bot]

This comment was marked as outdated.

…ed-intake

# Conflicts:
#	templates/content/actions/add-database-item.ts
builder-io-integration[bot]

This comment was marked as outdated.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@builder-io-integration builder-io-integration 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.

Builder reviewed your changes — looks good ✅

Review Details

Code Review Summary

This incremental review covers the expanded Content database discovery flow: server-side pagination and continuation metadata, client-side complete-list fetching with consistency checks, and retryable error states in the database source pickers. The implementation is sound: ordinary discovery is bounded and paginated, exact resolution limits duplicate detection to two rows without weakening fail-closed behavior, source-chain exclusions are applied before paging, and the client rejects missing, inconsistent, repeated, or clipped pagination rather than presenting a plausible incomplete list.

The UI changes use the shared QueryErrorState with an explicit retry path, while the A2A surface remains limited to the intended authenticated reads and delegated writes. Four parallel balanced code reviews found no new actionable issues, and focused discovery, hook, and capability tests passed. Risk assessment: Standard.

🧪 Browser testing: Attempted after the UI changes, but skipped verification because Chrome MCP/browser automation tools were unavailable environment-wide. The dev server was reachable at http://127.0.0.1:8080/content; all 12 planned cases were reported as couldnt_verify due to the tooling environment, not an application failure.

@3mdistal
3mdistal merged commit 3bcc0bd into main Aug 14, 2026
96 of 98 checks passed
@3mdistal
3mdistal deleted the codex/content-delegated-intake branch August 14, 2026 17:55
@netlify

This comment has been minimized.

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.

2 participants