Skip to content

feat(persona-kit): add IntegrationConfig.source discriminator (deployer_user | workspace | workspace_service_account)#97

Merged
khaliqgant merged 2 commits into
mainfrom
feat/persona-integration-source
May 13, 2026
Merged

feat(persona-kit): add IntegrationConfig.source discriminator (deployer_user | workspace | workspace_service_account)#97
khaliqgant merged 2 commits into
mainfrom
feat/persona-integration-source

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented May 12, 2026

Summary

Spec reference

Source spec: workforce/docs/plans/deploy-v1-schema-cascade-spec.md

Track section: Track E5 — rebase #97 (feat/persona-integration-source)

Final signoff

Verification complete. All Track E5 acceptance bullets from `docs/plans/deploy-v1-schema-cascade-spec.md` section "Track E — Workforce queue rebase (#92, #93, #94, #96, #97)" pass against the actual files in `$WORKFORCE_REPO.wt-rebase-97`.

**Evidence:**

1. **Rebased onto post-Track-D main** — merge-base of `HEAD` (2be5f77) and `origin/main` (19ebbee) equals `origin/main` tip; branch has exactly one commit ahead.
2. **Pushed successfully** — `Your branch is up to date with 'origin/feat/persona-integration-source'`. No force-with-lease needed since worktree matches remote.
3. **CI green** — `gh pr view 97` → CI workflow `check` = SUCCESS (run 25768449797), CodeRabbit = SUCCESS, PR MERGEABLE, not draft.
4. **Interface name is `PersonaIntegrationConfig`** (spec requirement) — confirmed in `packages/persona-kit/src/types.ts:184`; new optional `source?: IntegrationSource` field added with documentation.
5. **No functional regression / PR original acceptance bullets**:
   - `IntegrationSource` discriminated union (`deployer_user` | `workspace` | `workspace_service_account` + `name`) exported from index.ts.
   - `parseIntegrationSource` validates kind enum, kebab-case slug name (≤64 chars), forbids `name` on non-service-account kinds.
   - Default-injection of `{ kind: 'deployer_user' }` when persona omits `source` — matches spec section "Track B" line 420 ("Mirror persona-kit's parser default-injection").
   - Fixtures present: `integration-source-{deployer,workspace,service-account}.json` round-trip through `parsePersonaSpec`.
   - Test coverage: default-injection, round-trip all three kinds, unknown kind rejected with field path, missing name on service-account rejected, non-kebab-case name rejected, `name` on wrong kind rejected.
6. **No conflicts** — `mergeable: MERGEABLE`.

---

SIGNOFF_FINAL: COMPLETE Track-E5

Final gate (typecheck + tests)

FINAL_E5_TSC=0
FINAL_E5_TESTS=0

> workforce@0.1.0 typecheck /Users/khaliqgant/Projects/AgentWorkforce/workforce.wt-integration-source
> corepack pnpm -r typecheck && corepack pnpm run typecheck:examples

Scope: 8 of 9 workspace projects
packages/daytona-runner typecheck$ tsc -p tsconfig.json --noEmit
packages/persona-kit typecheck$ tsc -p tsconfig.json --noEmit
packages/daytona-runner typecheck: Done
packages/persona-kit typecheck: Done
packages/runtime typecheck$ tsc -p tsconfig.json --noEmit
packages/workload-router typecheck$ tsc -p tsconfig.json --noEmit
packages/workload-router typecheck: Done
packages/runtime typecheck: Done
packages/deploy typecheck$ tsc -p tsconfig.json --noEmit
packages/deploy typecheck: Done
packages/cli typecheck$ tsc -p tsconfig.json --noEmit
packages/cli typecheck: Done
packages/agentworkforce typecheck$ node --check bin/agentworkforce.js
packages/agentworkforce typecheck: Done

> workforce@0.1.0 typecheck:examples /Users/khaliqgant/Projects/AgentWorkforce/workforce.wt-integration-source
> tsc -p examples/tsconfig.json --noEmit

packages/cli test: # Subtest: computeTuiView: matches mode honors visibleCap
packages/cli test: ok 163 - computeTuiView: matches mode honors visibleCap
packages/cli test:   ---
packages/cli test:   duration_ms: 0.032875
packages/cli test:   type: 'test'
packages/cli test:   ...
packages/cli test: # Subtest: loadRecents returns [] when the file is absent or corrupt
packages/cli test: ok 164 - loadRecents returns [] when the file is absent or corrupt
packages/cli test:   ---
packages/cli test:   duration_ms: 0.370584
packages/cli test:   type: 'test'
packages/cli test:   ...
packages/cli test: 1..164
packages/cli test: # tests 164
packages/cli test: # suites 0
packages/cli test: # pass 164
packages/cli test: # fail 0
packages/cli test: # cancelled 0
packages/cli test: # skipped 0
packages/cli test: # todo 0
packages/cli test: # duration_ms 44541.932959
packages/cli test: Done
packages/agentworkforce test$ node --check bin/agentworkforce.js && node --test test/*.test.js
packages/agentworkforce test: TAP version 13
packages/agentworkforce test: # Subtest: agentworkforce --version prints the wrapper package version
packages/agentworkforce test: ok 1 - agentworkforce --version prints the wrapper package version
packages/agentworkforce test:   ---
packages/agentworkforce test:   duration_ms: 70.935167
packages/agentworkforce test:   type: 'test'
packages/agentworkforce test:   ...
packages/agentworkforce test: 1..1
packages/agentworkforce test: # tests 1
packages/agentworkforce test: # suites 0
packages/agentworkforce test: # pass 1
packages/agentworkforce test: # fail 0
packages/agentworkforce test: # cancelled 0
packages/agentworkforce test: # skipped 0
packages/agentworkforce test: # todo 0
packages/agentworkforce test: # duration_ms 187.787125
packages/agentworkforce test: Done

Self-reflection report

REFLECT_GAPS:
- "Rebased branch pushes successfully with `--force-with-lease`" -- NOT YET PERFORMED. Branch tip is `11e6df5` based on `origin/main` (`19ebbee`). Track D (`refactor/persona-kit-schema-lockin`) is the actual precondition for E5's rebase and has NOT been merged to `origin/main` yet — it still exists only as the local working branch in `$WORKFORCE_REPO`. The spec gates E5 on Track D merged ("Depends on: Track D merged"); since D isn't merged, no post-D rebase has happened.
- "No content change beyond rebase" (spec line: `E5 | #97 | ... | Rebase. Interface name is PersonaIntegrationConfig (verified in #97). No content change beyond rebase.`) -- VIOLATED. The branch carries three commits with files unrelated to the `PersonaIntegrationConfig.source` feature:
  - `188e9ec specs` adds `docs/plans/deploy-v1-codex-spec.md` (existed on main, fine) AND `docs/plans/deploy-v1-schema-cascade-spec.md` (does NOT exist on `origin/main`)
  - `109cac0 bring in latest` re-touches `docs/plans/deploy-v1-schema-cascade-spec.md`
  - `10d6837 add files` adds `docs/plans/deploy-v1-schema-cascade-spec.md` (+1451 lines) and `workflows/generated/ricky-ricky-workflow-spec-...ts` (+1551 lines)
  These produce 3002 of the 3273 lines in `git diff origin/main --stat` and are spec/workflow scaffolding, not E5 feature content. They must be dropped from PR #97 before merge.
- "CI on the PR is green after rebase" -- UNVERIFIABLE LOCALLY but local gates (`pnpm --filter @agentworkforce/persona-kit build`, `pnpm --filter @agentworkforce/persona-kit test` → 159/159, `pnpm run typecheck` across workspace) all pass on the current branch state. CI status on GitHub for PR #97 was not checked in this reflection.
- "No functional regression vs the PR's original acceptance bullets" -- ADDRESSED. `IntegrationSource` discriminator (`types.ts:170` region, 3-kind union) + `parseIntegrationSource` + `INTEGRATION_SOURCE_NAME_RE` exports (`index.ts:22,57,66`), default-injection of `{ kind: 'deployer_user' }` in `parseIntegrationConfig` (`parse.ts:551`), 7 new tests covering all kinds + default-injection + invalid kind/name/extra-name rejection + fixture round-trip (`parse.test.ts:518-628`), and 3 fixtures under `packages/persona-kit/src/__fixtures__/personas/`. Persona-kit feature surface is intact.
- Track D conflict surface check (not an explicit bullet, but required for "rebase will succeed"): the discriminator changes in this PR sit in the `parseIntegrationConfig` / `IntegrationSource` regions of `parse.ts` and `types.ts`; Track D's deletions target `traits` and `sandbox` (different sections of the same files). No overlapping hunks, so the post-Track-D rebase should be conflict-free — but it still needs to be executed and force-pushed once Track D lands.

Known gaps after this PR

⚠️ Memory is not wired. is a stub in v1; see § Loud hole. Memory wiring lands in a follow-up workflow (not yet specced).

⚠️ M3 destroy/list CLI commands not implemented. Separate workflow.

⚠️ ** not on npm** under scope. Handled by a separate agent per platform-team OIDC setup; not blocking morning state because cloud consumes via workspace ref.

Co-Authored-By: Ricky deploy-v1 schema cascade noreply@agentworkforce.com

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Review Change Stack

Warning

Rate limit exceeded

@khaliqgant has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 58 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: deb83485-270b-46e9-857a-a0eaf45bfd28

📥 Commits

Reviewing files that changed from the base of the PR and between 2be5f77 and 16832e0.

📒 Files selected for processing (4)
  • packages/persona-kit/src/index.ts
  • packages/persona-kit/src/parse.test.ts
  • packages/persona-kit/src/parse.ts
  • packages/persona-kit/src/types.ts
📝 Walkthrough

Walkthrough

This PR introduces an IntegrationSource type system to persona-kit that allows specifying which cloud resolver (deployer user, workspace, or workspace service account) should handle integration lookups. The change includes type definitions, parsing validation with kebab-case name enforcement, public exports, and comprehensive tests with three fixture personas exercising each resolver variant.

Changes

Integration Source Type System

Layer / File(s) Summary
IntegrationSource type contract and config extension
packages/persona-kit/src/types.ts
Adds IntegrationSource discriminated union with three kinds: deployer_user, workspace, and workspace_service_account (with required name field). Extends PersonaIntegrationConfig with optional source?: IntegrationSource property, defaulting to deployer_user behavior when omitted.
Integration source parsing and validation
packages/persona-kit/src/parse.ts
Exports INTEGRATION_SOURCE_NAME_RE constant and parseIntegrationSource() function that validates kind membership and enforces workspace_service_account.name to be non-empty, kebab-case, and ≤64 chars. Updates parseIntegrationConfig() to destructure source, apply default-injection of { kind: 'deployer_user' } when omitted, and parse/validate provided sources.
Public API re-exports
packages/persona-kit/src/index.ts
Re-exports IntegrationSource type, INTEGRATION_SOURCE_NAME_RE constant, and parseIntegrationSource function to expose integration source functionality as public package API.
Test coverage and fixture validation
packages/persona-kit/src/parse.test.ts, packages/persona-kit/src/__fixtures__/personas/integration-source-*.json
Extends parseIntegrations test expectations to verify default-injection of deployer_user source. Adds comprehensive test suite verifying default-injection behavior, round-tripping all source kinds, rejecting unknown kinds with precise error paths, enforcing workspace_service_account constraints, and prohibiting name field for deployer_user/workspace. Includes three fixture personas (integration-source-deployer, integration-source-service-account, integration-source-workspace) exercising each resolver variant and trigger type.

Sequence Diagram(s)

sequenceDiagram
  participant Parser as parseIntegrationConfig
  participant SourceParser as parseIntegrationSource
  participant Result as Validated Config
  
  Parser->>Parser: Destructure source field
  alt source provided
    Parser->>SourceParser: Validate source object
    SourceParser->>SourceParser: Check kind membership
    alt workspace_service_account
      SourceParser->>SourceParser: Validate name (kebab-case, length)
      SourceParser-->>Parser: Returns validated source
    else other kind
      SourceParser-->>Parser: Returns source as-is
    end
  else source omitted
    Parser->>Parser: Default to deployer_user
  end
  Parser-->>Result: out.source populated
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • AgentWorkforce/workforce#72: Scaffold PR introduces placeholder packages/persona-kit/src/index.ts; this PR replaces that with functional exports of IntegrationSource, INTEGRATION_SOURCE_NAME_RE, and parseIntegrationSource.
  • AgentWorkforce/workforce#81: Introduces packages/persona-kit/src/parse.test.ts test suite; this PR extends it with parseIntegrations validation and IntegrationSource fixture round-tripping.

Suggested reviewers

  • willwashburn

Poem

🐰 A source of truth, three flavors clear:
Deployer, workspace, service near.
Kebab-named accounts we validate strong,
Fixtures prove each integration path belongs! 🌟

🚥 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
Title check ✅ Passed The title accurately describes the main change: adding an IntegrationSource discriminator with three variants to PersonaIntegrationConfig.
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.
Description check ✅ Passed The PR description comprehensively documents the feature (IntegrationSource discriminator), spec reference, verification status, test coverage, and known follow-ups, all directly related to the changeset.

✏️ 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/persona-integration-source

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

@khaliqgant khaliqgant marked this pull request as ready for review May 12, 2026 20:56
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Base automatically changed from refactor/flatten-persona-tiers to main May 12, 2026 21:09
@khaliqgant khaliqgant force-pushed the feat/persona-integration-source branch from 4f1dc8c to 11e6df5 Compare May 12, 2026 22:29
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 `@docs/plans/deploy-v1-schema-cascade-spec.md`:
- Line 47: Several fenced code blocks in the document are unlabeled and trigger
markdownlint MD040; update each unlabeled triple-backtick fence (examples
containing "HOME=/Users/khaliqgant", "GITHUB_TOKEN", and the "persona_versions"
schema block) to include an appropriate language tag (e.g., ```bash for shell
snippets, ```text for plain tokens like GITHUB_TOKEN, ```sql for schema blocks).
Apply the same fix to all other unlabeled fences listed (lines with the same
patterns) so every ``` fence has a language label.
🪄 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: CHILL

Plan: Pro Plus

Run ID: 52558f0e-29fc-4c92-ba10-c574efba60fc

📥 Commits

Reviewing files that changed from the base of the PR and between 19ebbee and 11e6df5.

⛔ Files ignored due to path filters (1)
  • workflows/generated/ricky-ricky-workflow-spec-deploy-v1-schema-cascade-persona-refactor-status-ready-for-r.ts is excluded by !**/generated/**
📒 Files selected for processing (8)
  • docs/plans/deploy-v1-schema-cascade-spec.md
  • packages/persona-kit/src/__fixtures__/personas/integration-source-deployer.json
  • packages/persona-kit/src/__fixtures__/personas/integration-source-service-account.json
  • packages/persona-kit/src/__fixtures__/personas/integration-source-workspace.json
  • packages/persona-kit/src/index.ts
  • packages/persona-kit/src/parse.test.ts
  • packages/persona-kit/src/parse.ts
  • packages/persona-kit/src/types.ts


### Required env

```
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 | 🟡 Minor | ⚡ Quick win

Add fenced code block languages to satisfy markdownlint MD040.

Line 47 and the other listed lines use unlabeled fenced blocks; this will keep triggering lint warnings.

Proposed fix pattern
-```
+```bash
 HOME=/Users/khaliqgant
 ROOT=$HOME/Projects/AgentWorkforce
 ...

- +text
GITHUB_TOKEN


-```
+```sql
persona_versions
  id uuid PK
  ...

Apply the same language-tag pattern to all remaining unlabeled fences in this file.
</details>


Also applies to: 58-58, 75-75, 255-255, 273-273, 294-294, 613-613, 617-617, 688-688, 723-723, 788-788, 1362-1362

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>

[warning] 47-47: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/plans/deploy-v1-schema-cascade-spec.md at line 47, Several fenced code
blocks in the document are unlabeled and trigger markdownlint MD040; update each
unlabeled triple-backtick fence (examples containing "HOME=/Users/khaliqgant",
"GITHUB_TOKEN", and the "persona_versions" schema block) to include an
appropriate language tag (e.g., bash for shell snippets, text for plain
tokens like GITHUB_TOKEN, sql for schema blocks). Apply the same fix to all other unlabeled fences listed (lines with the same patterns) so every fence
has a language label.


</details>

<!-- fingerprinting:phantom:poseidon:hawk -->

<!-- d98c2f50 -->

<!-- This is an auto-generated comment by CodeRabbit -->

Introduce an `IntegrationSource` discriminated union (`deployer_user` |
`workspace` | `workspace_service_account`) and add an optional `source`
field on `PersonaIntegrationConfig`. The parser default-injects
`{ kind: 'deployer_user' }` when `source` is omitted, so existing
personas keep their pre-discriminator behavior.

This unblocks the cloud-side two-table integration resolver
(cloud#553): without `source`, the resolver cannot know whether a
persona's declared integration should look up `user_integrations` or
`workspace_integrations`.

Surface stays types + parse + fixtures only — runtime resolution
wiring waits for workforce#92 to land.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@khaliqgant khaliqgant force-pushed the feat/persona-integration-source branch from 11e6df5 to 2be5f77 Compare May 12, 2026 23:32
…ion-source

# Conflicts:
#	packages/persona-kit/src/parse.test.ts
#	packages/persona-kit/src/types.ts
@khaliqgant khaliqgant merged commit 5b5fcd6 into main May 13, 2026
1 of 2 checks passed
@khaliqgant khaliqgant deleted the feat/persona-integration-source branch May 13, 2026 08:21
khaliqgant pushed a commit that referenced this pull request May 13, 2026
`emit-schema.test` failed on main because PR #97 (IntegrationConfig.source
discriminator) added three new fixtures but they were missing two
schema-required fields (`onEvent` for cloud personas, `skills`) and the
test's hardcoded expected-filename list wasn't updated.

Three small fixes:
  1. `emit-schema.test.ts`: add the three new fixture names to the
     expected-filenames deepEqual.
  2. `integration-source-{deployer,workspace,service-account}.json`:
     add `"onEvent": "./agent.ts"` and `"skills": []` to each, matching
     the pattern used in `full.json` / `cron-only.json`.

The fixtures still exercise their intended IntegrationSource shapes
(no-source default-inject, explicit `workspace`, explicit
`workspace_service_account`) — only the cross-cutting required-for-cloud
fields were added.

Verified: `pnpm -F @agentworkforce/persona-kit test` → 162/162 pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request May 13, 2026
…p-workforce build (#104)

* chore(publish): add runtime + deploy + mcp-workforce to the publish allow-list

The publish.yml allow-list was last updated when the workspace had 5
packages (persona-kit, workload-router, cli, daytona-runner,
agentworkforce). The deploy-v1 cascade shipped 3 more under
@agentworkforce/* that the existing cli already depends on:

  - @agentworkforce/runtime       (consumed by deploy, mcp-workforce)
  - @agentworkforce/deploy        (consumed by cli)
  - @agentworkforce/mcp-workforce (consumed by harness CLIs via MCP)

cli@3.0.1 already declares `@agentworkforce/deploy@0.0.0` as a runtime
dep, but deploy was never published — the 0.0.0 on npm is a placeholder,
so `npm i agentworkforce` today pulls a stub for `workforce deploy`. The
same applies to deploy/mcp-workforce's runtime dep.

This change preserves lockstep umbrella semantics and orders the publish
in topological order (runtime before deploy/mcp-workforce, deploy before
cli, cli before agentworkforce).

personas-core stays on publish-personas.yml as before — not added here.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(mcp-workforce): align memory scope enum with PersonaMemoryScope

mcp-workforce was landed in #91 against an older `PersonaMemoryScope`
shape (`session | user | workspace | org | object`). #94 then tightened
the type to `workspace | user | global`. Both PRs passed CI
independently, but main is now broken at build time because the zod enum
in `server.ts` and the runtime `VALID_SCOPES` Set in `tools/memory.ts`
still reference the removed literals.

Aligning both call sites to the canonical persona-kit shape:

  - `MEMORY_SCOPE_ENUM` → z.enum(['workspace', 'user', 'global'])
  - `VALID_SCOPES`      → new Set(['workspace', 'user', 'global'])
  - memory.save tool description updated to match

The default scope stays `workspace`. Callers that previously passed
`'session'`/`'org'`/`'object'` will now get a validation error from the
zod schema before the runtime check — preferable to silently mapping
them to a different scope.

Verified: `pnpm -F @agentworkforce/mcp-workforce typecheck` + `build` +
`test` (23/23) all pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(publish): sync release-notes packageOrder with expanded allow-list

CodeRabbit + Devin both flagged that the `packageOrder` array used to
sort release-note entries was not updated alongside the publish
allow-list, so `runtime` / `deploy` / `mcp-workforce` would have
`indexOf === -1` and sort first (or in an arbitrary order depending on
the sort impl).

Mirror the topological order from "Resolve target packages":
  persona-kit → runtime → workload-router → deploy → mcp-workforce
    → daytona-runner → cli → agentworkforce

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(examples): linear-shipper read spec metadata from inputSpecs

`ctx.persona.inputs` is `Record<string, string>` (resolved values) on
WorkforcePersonaContext; the raw `PersonaInputSpec` with `.env` and
`.default` lives at `ctx.persona.inputSpecs`. The earlier env-var-
precedence patch on PR #93 read .env / .default off `.inputs`, which
only worked while the type was loose. The post-cascade readonly tightening
exposed the bug at typecheck time and broke the examples typecheck job.

Also fold the runtime-resolved value into the fallback chain so we
prefer env > resolved > spec.default — matching `resolvePersonaInputs`.

Verified: `pnpm run typecheck` + `pnpm run typecheck:examples` both
clean after rebuilding @agentworkforce/deploy dist.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(persona-kit): make integration-source fixtures pass the schema test

`emit-schema.test` failed on main because PR #97 (IntegrationConfig.source
discriminator) added three new fixtures but they were missing two
schema-required fields (`onEvent` for cloud personas, `skills`) and the
test's hardcoded expected-filename list wasn't updated.

Three small fixes:
  1. `emit-schema.test.ts`: add the three new fixture names to the
     expected-filenames deepEqual.
  2. `integration-source-{deployer,workspace,service-account}.json`:
     add `"onEvent": "./agent.ts"` and `"skills": []` to each, matching
     the pattern used in `full.json` / `cron-only.json`.

The fixtures still exercise their intended IntegrationSource shapes
(no-source default-inject, explicit `workspace`, explicit
`workspace_service_account`) — only the cross-cutting required-for-cloud
fields were added.

Verified: `pnpm -F @agentworkforce/persona-kit test` → 162/162 pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Ricky Schema Cascade <ricky@agent-relay.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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