Skip to content

Add saved company onboarding assessments - #992

Merged
sidneyswift merged 3 commits into
mainfrom
codex/company-assessment
Oct 10, 2026
Merged

sidneyswift merged 3 commits into
mainfrom
codex/company-assessment

Conversation

@sidneyswift

@sidneyswift sidneyswift commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Saved Context briefs currently serve creative direction and playlist pitches. Add company_onboarding so a company can review cited saved evidence, see missing coverage and per-request review steps, save the assessment and reopen it through existing HTTP/standard MCP operations.

The scope is selected saved Context requests, not the complete company register. Submitted identity remains an assertion; metadata/credits do not establish rights or mandates. No collection, model dispatch, original upload or new assessment store. Based directly on main; no original-intake dependency stack.

Validation: two new compile/save/reopen fixtures failed before implementation; Context suite 131 passed, 6 skipped; full lint, scoped TypeScript, formatting and diff checks pass. Backend boundaries are mocked in API fixtures. Requires the database purpose migration before release. No hosted Records assessment has been saved or read.


Summary by cubic

Adds a company_onboarding purpose to saved Context briefs so a company can compile an assessment from selected saved requests without new collection, dispatch, or storage.

  • Supports one to ten saved requests via additional_request_ids, returning attributed company evidence (including submitted release locators), missing-topic coverage, and per-request next_steps for evidence review.
  • Assessment guidance treats quoted evidence as source material only and keeps submitted names, metadata, and credits separate from verified rights, ownership, or mandates.
  • Saves and reopens through existing snapshot operations with assessment_scope set to selected_saved_context_requests; requires the database purpose migration before release, and local fixtures do not cover hosted Records assessments.

Written for commit 3f8cd74. Summary will update on new commits.

View guided diff Turn on auto-fix

@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api Ready Ready Preview Oct 10, 2026 1:06am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: recoupable/api/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1f0901a3-60eb-468a-ba11-3d34a5e1405e

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 4 files

Architecture diagram
sequenceDiagram
    participant C as Client
    participant API as HTTP/MCP API
    participant POC as processContextOperation
    participant CCB as compileContextBrief
    participant SCD as selectContextDocuments
    participant RPC as RPC Layer
    participant DB as Database

    Note over C,DB: NEW: Company Onboarding Assessment Flow

    C->>API: POST /api/context or MCP<br/>{action: "save_brief",<br/>purpose: "company_onboarding",<br/>request_id, additional_request_ids[1-9],<br/>organization_id?, idempotency_key}
    API->>POC: save_brief operation
    POC->>POC: Validate purpose enum<br/>(company_onboarding allowed)
    POC->>RPC: read_context_request<br/>(primary request)
    RPC->>DB: Fetch saved request
    DB-->>RPC: Request + subject IDs
    RPC-->>POC: Request data

    loop For each additional_request_id
        POC->>RPC: read_context_request
        RPC->>DB: Fetch additional request
        DB-->>RPC: Request + subject IDs
        RPC-->>POC: Request data
    end

    POC->>RPC: read_context_documents
    RPC->>DB: Fetch cited evidence documents
    DB-->>RPC: Documents (company/creator/artist/catalog evidence)
    RPC-->>POC: Document list

    POC->>CCB: compileContextBrief({purpose: "company_onboarding",<br/>requests, documents, maxCharacters})
    CCB->>SCD: selectContextDocuments(documents, ownerId)
    SCD->>SCD: Filter by owner + accepted status
    SCD-->>CCB: Selected evidence

    CCB->>CCB: Build company_onboarding recipe<br/>(title, objective, topics)
    CCB->>CCB: Generate guidance:<br/>"selected_saved_context_requests<br/>not complete register"
    CCB->>CCB: Calculate per-request coverage

    alt Has missing topics
        CCB->>CCB: next_steps = [{action: "review_missing_evidence",<br/>topics: missing[]}]
    else All topics covered
        CCB->>CCB: next_steps = [{action: "review_available_evidence",<br/>topics: []}]
    end

    CCB-->>POC: Assessment brief with<br/>assessment_scope, next_steps,<br/>readiness, attributed evidence

    POC->>RPC: save_context_brief(snapshot)
    RPC->>DB: Persist assessment snapshot
    DB-->>RPC: Snapshot ID
    RPC-->>POC: Saved confirmation
    POC-->>API: {snapshot: {state: "saved",<br/>brief: assessment}}
    API-->>C: Success response

    Note over C,DB: Reopen Flow (existing snapshot operations)

    C->>API: POST /api/context<br/>{action: "read_brief", brief_id}
    API->>POC: read_brief operation
    POC->>RPC: read_context_brief
    RPC->>DB: Fetch saved assessment
    DB-->>RPC: Snapshot data
    RPC-->>POC: Assessment brief
    POC-->>API: Reopened assessment
    API-->>C: Assessment content

    Note over POC,DB: No new collection, model dispatch,<br/>or original upload in this flow
Loading

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread lib/context/compileContextBrief.ts Resolved
Comment thread lib/context/compileContextBrief.ts Resolved
Comment thread lib/context/compileContextBrief.ts Resolved

@cubic-dev-ai cubic-dev-ai 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.

0 issues found across 3 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Adds company_onboarding assessments to saved Context briefs with new guidance, next_steps, and tests; release depends on a database purpose migration not present in this diff, and the assessment scope/coverage semantics are a product/data tradeoff.

View guided diff | Turn on auto-fix | Re-trigger cubic

This branch was successfully deployed

1 active deployment
Preview — 3f8cd740 Deployed Oct 10, 2026 by vercel[bot]
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