Skip to content

feat: adopt scope:fn naming convention for job task identifiers#1118

Closed
pyramation wants to merge 2 commits into
mainfrom
feat/scope-fn-convention
Closed

feat: adopt scope:fn naming convention for job task identifiers#1118
pyramation wants to merge 2 commits into
mainfrom
feat/scope-fn-convention

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Establishes a scope:function_name naming convention for all job task identifiers, enabling per-scope Knative service routing and independent autoscaling.

Changes

Node-type-registry defaults — all blueprint node defaults now use scoped identifiers:

  • process_file_embeddingembed:process_file_embedding
  • process_image_embeddingembed:process_image_embedding
  • generate_embeddingembed:generate_embedding
  • generate_chunkschunk:generate_chunks

Scope-aware routing (job-utils + knative-job-worker):

  • Added parseScopedIdentifier() and getJobGatewayScopeUrls() to job-utils
  • Worker routing now: (1) exact dev map match → (2) scope-based routing via INTERNAL_GATEWAY_SCOPE_URLS → (3) gateway fallback
  • Legacy unscoped identifiers continue to work (backward compatible)

knative-job-service: Added scoped aliases (email:send_email_link, email:simple_email) in the function registry, pointing to the same implementations.

Docker compose: Updated JOBS_SUPPORTED and INTERNAL_GATEWAY_DEVELOPMENT_MAP with both scoped and legacy identifiers. Added INTERNAL_GATEWAY_SCOPE_URLS for per-scope service routing.

Documentation: Added Section 5 "Task Identifier Naming Convention" to jobs/README.md with the full identifier table, routing priority, and env var reference.

Convention

<scope>:<function_name>
  • scope = capability domain (email, embed, chunk, extract, sms)
  • function_name = specific operation in snake_case
  • Each scope maps to an independent Knative service with its own scaling/resource profile

Review & Testing Checklist for Human

  • Verify the scope:fn convention makes sense for your deployment topology — each scope becomes an independently scalable Knative service
  • Check that legacy send-email-link / simple-email identifiers still route correctly via the dev map fallback
  • Review INTERNAL_GATEWAY_SCOPE_URLS env var pattern — this is the new production routing mechanism

Notes

  • Existing SQL callers in constructive-db (e.g. add_job('send-email-link', ...)) are unchanged — they'll need a follow-up PR in that repo to adopt scoped names
  • Blueprint defaults only affect NEW blueprints; existing provisioned blueprints retain their stored task identifiers
  • A companion function registry file will be added to constructive-db as the source-of-truth for all job-queued functions

Link to Devin session: https://app.devin.ai/sessions/0bebbaeb3b374fd28f5ed051354b3b94
Requested by: @pyramation

- Update all blueprint node defaults to use scoped task identifiers:
  - embed:process_file_embedding, embed:process_image_embedding
  - embed:generate_embedding, chunk:generate_chunks
- Add scope-aware routing to knative-job-worker (parseScopedIdentifier,
  INTERNAL_GATEWAY_SCOPE_URLS env var for per-scope service routing)
- Add scoped aliases to knative-job-service function registry
- Update docker-compose files with scoped identifiers + backward compat
- Document naming convention in jobs/README.md (Section 5)
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Combine scope routing infrastructure from this PR with the renamed
function identifiers from PR #1124 (now on main).
@pyramation pyramation closed this May 11, 2026
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