Skip to content

test: tests for the agent and shared layers - #1387

Closed
gewenyu99 wants to merge 1 commit into
posthog/functional-r9-13-remove-old-files-replaced-by-the-new-shafrom
posthog/functional-r9-14-tests-for-the-agent-and-shared-layers
Closed

gewenyu99 wants to merge 1 commit into
posthog/functional-r9-13-remove-old-files-replaced-by-the-new-shafrom
posthog/functional-r9-14-tests-for-the-agent-and-shared-layers

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Phase 2 of Release C (#1320), PR 11 of 16, after #1386. Tests only. PRs 1 to 14 of this phase split one change into reviewable pieces and compile only as a stack: review them one by one, then land the whole phase together.

Problem

#1376 and #1378 move shared code out of the agent layer and change RunConfig, so their tests must follow. Some tests locked only what is gone, such as the PROGRAM_BINDINGS table.

Changes

Tests only: 38 files in src/agent and src/shared.

  • New: run-agent-linear-sdk.test.ts covers runAgent on the linear SDK path (the run's prompt, abort, classified failures, progress order). console-log.test.ts covers printAbortOutro.
  • Moved with the code: src/shared/__tests__/skill-install.test.ts takes the skill download cases from wizard-tools.test.ts, zip-slip checks included.
  • Updated: switchboard.test.ts and flags.test.ts pass a binding in the context, agent-interface.test.ts and run-agent-standalone.test.ts build RunConfig with routing, and gateway-session.test.ts follows the per-run gateway setup.
  • Trimmed: commandments.test.ts and src/shared/errors/__tests__/codes.test.ts.
  • Removed: the debug() cases, the PROGRAM_BINDINGS cases, part of handoff-schema-parity.test.ts, and the settings-conflict case of credential-isolation-snapshot.test.ts, which settings-conflicts.test.ts covers. The sessionProperties and ask-gate cases move to the programs tests in test: tests for the programs layer #1388.
  • The rest are small updates, for example OutroKind from @shared/outro, and dropping the @ui mocks now that @ui is gone.

Test plan

Created with PostHog Desktop

@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

@gewenyu99
gewenyu99 added this pull request to stack #1394 September 29, 2026 09:41
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-14-tests-for-the-agent-and-shared-layers branch from 1a9a29c to a162b69 Compare September 30, 2026 08:06
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-13-remove-old-files-replaced-by-the-new-sha branch from 616023a to 50c996d Compare September 30, 2026 08:06
@gewenyu99
gewenyu99 removed this pull request from stack #1394 September 30, 2026 08:07
@gewenyu99
gewenyu99 added this pull request to stack #1400 September 30, 2026 08:07
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-14-tests-for-the-agent-and-shared-layers branch from a162b69 to c92c697 Compare September 30, 2026 08:44
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-13-remove-old-files-replaced-by-the-new-sha branch from 50c996d to 5fccf03 Compare September 30, 2026 08:44
@gewenyu99
gewenyu99 marked this pull request as ready for review September 30, 2026 09:16
@gewenyu99
gewenyu99 requested a review from a team as a code owner September 30, 2026 09:16
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-13-remove-old-files-replaced-by-the-new-sha branch from 5fccf03 to a777dfd Compare September 30, 2026 14:11
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-14-tests-for-the-agent-and-shared-layers branch 2 times, most recently from 9829199 to f163fa6 Compare October 1, 2026 06:43
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-13-remove-old-files-replaced-by-the-new-sha branch from a777dfd to 3388dae Compare October 1, 2026 06:43
@gewenyu99
gewenyu99 removed this pull request from stack #1400 October 1, 2026 06:47
@gewenyu99
gewenyu99 added this pull request to stack #1403 October 1, 2026 06:47

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

Note

Automated review. Not written by a human.

  • PR description: it lists commandments.test.ts and src/shared/errors/__tests__/codes.test.ts as removed, but both files are only trimmed. Please update the description.

});
});

describe('seam scan — routing reads live only in flags/', () => {

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.

Note

Automated review. Not written by a human.

The seam scan is still deleted, and nothing replaces it. Every file it scanned (harness.ts, sequence.ts, models.ts, index.ts, orchestrator-runner.ts) still exists and none reads flags directly, so it would still pass. I couldn't find a lint rule or another test that keeps ctx.flags[...] reads and WIZARD_*_FLAG_KEY imports inside flags/. The block imports nothing from @programs, so could it stay?

thinkingLevel: 'medium',
} as const;

describe('flag declarations', () => {

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.

Note

Automated review. Not written by a human.

With these declaration checks gone, and the isolation test using a synthetic uncovered-program, nothing pins that wizard-orchestrator covers exactly posthog-integration or that self-driving covers exactly self-driving. Adding metrics to ORCHESTRATOR_SEQUENCE_ROUTE.programs would pass every test. These checks import only from flags/, so they fit the new layer rules. Please keep them.

@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-13-remove-old-files-replaced-by-the-new-sha branch from 3388dae to 989ddd1 Compare October 2, 2026 16:47
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-14-tests-for-the-agent-and-shared-layers branch from f163fa6 to 2e19791 Compare October 2, 2026 16:47
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-13-remove-old-files-replaced-by-the-new-sha branch from 989ddd1 to 85e2539 Compare October 2, 2026 20:50
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-14-tests-for-the-agent-and-shared-layers branch from 2e19791 to 0de82f1 Compare October 2, 2026 20:50
Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-14-tests-for-the-agent-and-shared-layers branch from 0de82f1 to 7bebc68 Compare October 3, 2026 20:40
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-13-remove-old-files-replaced-by-the-new-sha branch from 85e2539 to 1cda88f Compare October 3, 2026 20:40

@edwinyjlim edwinyjlim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review of #1387 at 7bebc68d. Comments inline.


Drafted with Claude Code from a review of the whole Release C stack, re-verified at the stack tip 2e31e438. Line numbers are at this PR's head.

// Targeted assertions for the wizard_ask Path A translation rules.
// These are the rules a skill author depends on when leaving their prose
// unchanged — they need to keep working as the commandment list evolves.
describe('wizard_ask Path A rules', () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P3] Eight commandments tests deleted although the commandments text did not change

src/agent/commandments.ts is byte-identical to main, and every phrase these tests matched is still there, so all eight would pass. The prompt snapshot tests do pin the full text, so this is not a total loss, but a blind snapshot update could now drop a Path A rule (wizard_ask named, no inline questions, batching, kebab-case ids, no re-asking) with nothing failing.

Suggested fix: Restore the two cases under "commandments by axis" and the whole "wizard_ask Path A rules" describe verbatim; only the joined-text constant needs to come back with them.

},
);

it('says the handoff is nested', () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P3] Orchestrator description and constant pins dropped though their subjects are unchanged

The complete-task description still says "one nested object" and names the handoff fields; TASK_NOTICE_TIMEOUT_MS is still exported. The "optional field" case is redundant and fine to drop.

Suggested fix: Restore the two description tests and the five-minute pin, or say in the body why they go.

@gewenyu99

Copy link
Copy Markdown
Collaborator Author

Folded into #1378 so the phase builds green PR by PR. This PR keeps its review; the code lands through #1378.

@gewenyu99 gewenyu99 closed this Oct 5, 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.

3 participants