Skip to content

Prototype Events identity with specification-owned fan-in - #8665

Closed
dpeacock wants to merge 3 commits into
events-subscription-fanoutfrom
dp-events-identity-alternative
Closed

dpeacock wants to merge 3 commits into
events-subscription-fanoutfrom
dp-events-identity-alternative

Conversation

@dpeacock

@dpeacock dpeacock commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Why

Make #8426's Events pull/deploy round trip honor module-only object identity while preserving legacy list entries, counts and effective API versions.

Alternative C — specification-owned aggregation

An opt-in specification reconstructs its entire app-config section from module envelopes. Events owns identity and default-version reconciliation; scalar transform options stay unchanged. Tradeoff: a broader collection API and section-ownership contract, in exchange for deterministic defaults and compact overrides.

Shared fixes preserve explicit empty-list clearing and normalize editing identity before fetched strict-schema validation. Outgoing object config has neither root nor nested handles. Needed #8425 robustness fixes are included because the common #8426 base predates them; author branches are untouched.

Review / validation

  • Original transform-test structure restored; overlapping integration suites consolidated. Final PR diff +1076/−133, 26% less churn; cleanup does not change production code, strict fixture or grouping tests.
  • 2,993 app tests passed, 2 skipped; package type-check/lint pass.
  • Real fetched-schema/TOML/manifest/no-op and generic ordering checks retained. Independent cleanup review found no gaps; all four injected regressions failed the retained tests.

Sibling draft alternative to A and B, not intended to merge alongside them. CLI-team approval remains outstanding. Writer gates are unchanged; migration continuity and live Core UUID behavior are unverified. No public changeset while this remains a prototype.

rezaansyed and others added 2 commits September 21, 2026 14:14
…g or environment opt-in

Assisted-By: devx/aa56a38c-289a-416e-8a9a-0de281e4e3e7
Let an opt-in specification reconstruct its complete app-config section
from module envelopes while existing scalar transforms keep their order
and fallback behavior. Events owns identity and version aggregation,
preserves explicit empty lists, and normalizes editing handles before
strict fetched-contract validation without duplicating wire identity.

This sibling alternative on events-subscription-fanout is not a rollout
change. Real TOML, manifest, strict-contract and generic-ordering tests
cover the tradeoff; collection ownership requires CLI-team agreement.
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Sep 25, 2026
Restore the original transform-test structure and apply only necessary
contract changes, so reviewers can see what behavior actually differs.
Consolidate the duplicated parser and empty-list integration scaffolding
while retaining strict fetched-schema, real TOML, manifest and no-op checks.

Production code and the strict schema fixture are unchanged. Independent
coverage review, full app tests, type-check, lint and targeted mutation
checks verify that the important regression guards remain effective.
@github-actions

Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/private/node/api.d.ts
@@ -37,21 +37,6 @@ export declare function isTransientNetworkError(error: unknown): boolean;
  * - Permanent: certificate validation failures, misconfigured SSL
  */
 export declare function isNetworkError(error: unknown): boolean;
-/**
- * Checks if an error is an aborted request: a user cancelling the command, the host process
- * cancelling it, or one of the CLI's own request timeouts firing.
- *
- * Not used by the retry logic, because a user-cancelled request must not be retried.
- * `isTransientNetworkError` separately matches the CLI's own timeout message, so timeouts do
- * still retry.
- *
- * The `name` check matches the `AbortError` shape that fetch throws, not cli-kit's own
- * `AbortError`, which leaves `name` as 'Error'.
- *
- * @param error - Error to be checked.
- * @returns A boolean indicating if the request was aborted.
- */
-export declare function isAbortedFetchError(error: unknown): boolean;
 export declare function simpleRequestWithDebugLog<T extends {
     headers: Headers;
     status: number;
packages/cli-kit/dist/public/node/local-storage.d.ts
@@ -48,7 +48,6 @@ export declare class LocalStorage<T extends Record<string, any>> {
      *
      * @param error - The error that occurred.
      * @param operation - The operation that failed.
-     * @param configPath - The local storage configuration file path.
      * @throws AbortError if the error is permission-related.
      * @throws BugError if the error is not permission-related.
      */
packages/cli-kit/dist/public/node/context/local.d.ts
@@ -11,12 +11,6 @@ export declare function isTerminalInteractive(): boolean;
  * @returns The path to the user's home directory.
  */
 export declare function homeDirectory(): string;
-/**
- * Clears the memoized result of isUnitTest so the environment variable is re-read.
- *
- * Only intended for test helpers that temporarily toggle unit-test detection.
- */
-export declare function resetMemoizedIsUnitTest(): void;
 /**
  * Returns true if the CLI is running in debug mode.
  *
packages/cli-kit/dist/public/node/testing/output.d.ts
@@ -8,36 +8,6 @@ interface OutputMock {
     error: () => string;
     clear: () => void;
 }
-interface StandardStreamsMock {
-    stdout: () => string;
-    stderr: () => string;
-    restore: () => void;
-}
-export interface CapturedStandardStreams {
-    stdout: () => string;
-    stderr: () => string;
-}
-/**
- * Runs a callback with process stdout/stderr captured and unit-test output suppression disabled,
- * so tests can assert on what a command actually writes to the standard streams.
- *
- * The callback receives accessors instead of the function returning captured output so that
- * assertions remain possible when the callback throws (for example commands that abort).
- * Streams, console.warn and unit-test detection are restored afterwards.
- * Not safe for concurrent tests.
- *
- * @param run - Callback receiving accessors for the captured stdout and stderr.
- * @returns The value returned by the callback.
- */
-export declare function withCapturedStandardStreams<T>(run: (streams: CapturedStandardStreams) => T | Promise<T>): Promise<T>;
-/**
- * Captures writes to stdout and stderr, including console warnings intercepted by Vitest.
- * Call restore in a finally block. This replaces process globals and must not be used in concurrent tests.
- * Prefer withCapturedStandardStreams, which also disables unit-test output suppression while it runs.
- *
- * @returns Captured output and a function to restore the original writers.
- */
-export declare function mockAndCaptureStandardStreams(): StandardStreamsMock;
 /**
  * Returns a set of functions to get the outputs ocurred during a test run.
  *

@cdarne
cdarne force-pushed the events-subscription-fanout branch 2 times, most recently from f32cb9e to 08bd94f Compare September 25, 2026 20:40
@dpeacock dpeacock closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants