diff --git a/.github/scripts/changed-sections.ts b/.github/scripts/changed-sections.ts index 2e710170..96ed70b0 100644 --- a/.github/scripts/changed-sections.ts +++ b/.github/scripts/changed-sections.ts @@ -1,11 +1,13 @@ /** * The diff-aware section selector for the PR e2e smoke job: a PR touching one section runs that section's scenarios * and fuzz rather than the whole corpus, and a PR touching nothing settings-related skips the smoke steps. A path - * under src/sections/, test/src/sections/, or docs/sections/ that no rule recognizes throws, so a new file cannot - * silently skip them. + * under src/sections/ or docs/sections/, or in a directory under test/sections/, that no rule recognizes throws, so a + * new file cannot silently skip them. * * src/sections//... -> , whatever the file - * test/src/sections//... -> (the section's tests, mock, generators, scenarios) + * test/sections//... -> (the section's tests, mock, generators, scenarios) + * test/sections/, test/sections/snapshot-rows/ -> none (the cross-section suites and their fixtures; a flat + * file named after a section is misplaced and throws) * docs/sections/.docs.yml -> ; shared.docs.yml and docs/schema.docs.yml select none * src/sections/shared/.ts -> the sections that transitively import it (deriveSharedFanOut) * contract/, registry.ts, the engine, the schema, the e2e harness -> every section @@ -296,24 +298,57 @@ function sectionsForSectionsPath( ); } -const TEST_MIRROR_PREFIX = "test/src/sections/"; +const TEST_SECTIONS_PREFIX = "test/sections/"; +/** The fixture directories beside the section mirrors under test/sections/: cross-section, like the flat suites. */ +const CROSS_SECTION_TEST_DIRS: ReadonlySet = new Set(["snapshot-rows"]); const SECTION_DOCS_PREFIX = "docs/sections/"; /** The document root's schema prose, gated by build:check like the docs registry. */ const ROOT_DOCS_FILE = "docs/schema.docs.yml"; /** The shared factories' schema prose: it belongs to no one section, and build:check gates it too. */ const SHARED_DOCS_FILE = `${SECTION_DOCS_PREFIX}shared.docs.yml`; -/** A section's tests, mock, generators, and scenarios mirror it under test/src/sections//; a deleted scenario can - * leave a route cold, so the section still runs. Anything else under the mirror root throws, as under src/sections/. */ -function sectionsForTestMirrorPath(path: string): SectionKey[] { - const rest = path.slice(TEST_MIRROR_PREFIX.length); +/** labels.test.ts and labels-schema.test.ts, but not list-section.test.ts: the stem is a key or its dashed slug, + * alone or before a dash or underscore. */ +function isSectionNamedFile(name: string): boolean { + const stem = name.split(".")[0] ?? ""; + return SECTION_KEYS.some((key) => { + const slug = key.replaceAll("_", "-"); + return ( + stem === key || + stem === slug || + stem.startsWith(`${key}-`) || + stem.startsWith(`${key}_`) || + stem.startsWith(`${slug}-`) || + stem.startsWith(`${slug}_`) + ); + }); +} + +/** A section's tests, mock, generators, and scenarios mirror it under test/sections//; a deleted scenario can + * leave a route cold, so the section still runs. The flat files beside those directories are the cross-section suites + * and select none, as does a fixture directory in CROSS_SECTION_TEST_DIRS. A flat file named after a section belongs + * in its directory, so it throws unless deleted (the fold of a flat suite into its directory is such a deletion, and + * the added file selects the section). */ +function sectionsForTestSectionsPath({ path, deleted }: ChangedFile): SectionKey[] { + const rest = path.slice(TEST_SECTIONS_PREFIX.length); const slash = rest.indexOf("/"); - const dir = slash < 0 ? "" : rest.slice(0, slash); + if (slash < 0) { + if (!deleted && isSectionNamedFile(rest)) { + throw new Error( + `changed-sections: ${path} matches no selector rule; a file named after a section lives in ${TEST_SECTIONS_PREFIX}/, not beside the cross-section suites`, + ); + } + return []; + } + const dir = rest.slice(0, slash); if (SECTION_KEY_SET.has(dir)) { return [dir as SectionKey]; } + if (CROSS_SECTION_TEST_DIRS.has(dir)) { + return []; + } throw new Error( - `changed-sections: ${path} matches no selector rule; ${TEST_MIRROR_PREFIX} holds only the per-section / directories, each spelling its SectionKey verbatim`, + `changed-sections: ${path} matches no selector rule; a directory under ${TEST_SECTIONS_PREFIX} spells its SectionKey verbatim (or is named in CROSS_SECTION_TEST_DIRS if it holds cross-section fixtures)`, ); } @@ -341,8 +376,8 @@ function sectionsForPath( if (path.startsWith("src/sections/")) { return sectionsForSectionsPath(file, sharedFanOut); } - if (path.startsWith(TEST_MIRROR_PREFIX)) { - return sectionsForTestMirrorPath(path); + if (path.startsWith(TEST_SECTIONS_PREFIX)) { + return sectionsForTestSectionsPath(file); } if (path.startsWith(SECTION_DOCS_PREFIX)) { return sectionsForSectionDocsPath(path); diff --git a/AGENTS.md b/AGENTS.md index 682e9df9..b657eec9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -49,7 +49,7 @@ Code is the source of truth: this section holds only the rules and the decisions ### Decisions a reader would otherwise reverse - A flat `src/sections//` directory means repository scope, permanently; org/user scopes arrive as sibling scope directories with their own document, keys, and registry (the ":" reservation in `src/sections/registry.ts`). -- The section directory is the unit of work: the compiler flags every forgotten registration step, its tests and e2e fragments mirror it under `test/src/sections//`, and its prose is `docs/sections/.docs.yml`. +- The section directory is the unit of work: the compiler flags every forgotten registration step, its tests and e2e fragments mirror it under `test/sections//`, and its prose is `docs/sections/.docs.yml`. - `src/upstream-gaps/` holds one file per GitHub feature an upstream artifact lags; `gap.ts` states how each kind graduates. - The layered fold is a CSS-like cascade in which `null` is a value: GitHub's EMPTY or OFF state, not CSS `unset`. docs/operate/layering.md owns the rules, including the two CSS has no analogue for (an undeclared key keeps GitHub's current value; `_remove: true` drops a keyed entry). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bb9c79f0..35485ec8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ The fleet-wide conventions - Conventional Commit titles, squash merges, the `all - Line caps: code wraps at biome's `lineWidth` of 100. The fleet's check-file-size caps source, test, workflow, and shell lines at 256 characters; markdown prose has no width cap. A comment block is at most 10 lines. - Markdown keeps one source line per paragraph or list item, so a long item is split into items, never wrapped. - A source file under `src/` or `.github/scripts/` opens with a one-paragraph header comment saying what the file owns; test files need none. -- Tests live under `test/`, mirroring `src/`: a section's unit tests, `mock.ts`, `generators.ts`, and `scenarios/` sit in `test/src/sections//`; `src/` holds code only. +- Tests live under `test/`, mirroring `src/`: a section's unit tests, `mock.ts`, `generators.ts`, and `scenarios/` sit in `test/sections//`; `src/` holds code only. ## Tests @@ -36,7 +36,7 @@ The fleet-wide conventions - Conventional Commit titles, squash merges, the `all The end-to-end tests build the bundle to a temp path and run it as a subprocess against a mock GitHub API, so they exercise the same single-file bundle a release ships. - `bun run test:e2e` runs the curated scenario corpus. -- Every section ships the standard scenario set under `test/src/sections//scenarios/`, named after the section's dashed key: `-apply-converges`, `-check-drift` (a section with a planning read), `-snapshot-roundtrip` (a section with snapshot()), and for a section under the undeclared policy `-undeclared-delete` and `-undeclared-keep-note`; `test/sections/scenario-set.test.ts` derives the set from the registry. +- Every section ships the standard scenario set under `test/sections//scenarios/`, named after the section's dashed key: `-apply-converges`, `-check-drift` (a section with a planning read), `-snapshot-roundtrip` (a section with snapshot()), and for a section under the undeclared policy `-undeclared-delete` and `-undeclared-keep-note`; `test/sections/scenario-set.test.ts` derives the set from the registry. - `bun run fuzz` runs seeded property fuzzing: random scenarios, each checked against an oracle that predicts the outcome class from the token mask, policy, and mode. - The mock serves the section endpoints plus the core routes the action calls outside the sections. A request that matches no registered route fails loudly; the mock never invents a response. - PR CI runs the sections a pull request changed. The nightly workflow's `e2e` job runs the full corpus and files a red night under the `nightly-failure` issue; the fuzz nightly runs the full fuzz and files under `fuzz-nightly` with a replay command. diff --git a/docs/reference/architecture.md b/docs/reference/architecture.md index 94ecbdf9..dd69f014 100644 --- a/docs/reference/architecture.md +++ b/docs/reference/architecture.md @@ -80,7 +80,7 @@ flowchart LR - The one live-axis knob is `_undeclared`: what happens to a live resource the file does not declare. A knobbed list section's wrapper sets it; a file's top-level `_undeclared` sets it for every knobbed list section of that file, and the run input `undeclared` for every file; the section's default applies where none is set. `environments`, `branches`, and `workflows` apply no policy and refuse the knob ([Undeclared policy](undeclared-policy.md)). - Re-running an apply rewrites nothing the engine can read back, and a check right after it reads clean. Writes whose value GitHub does not read back recur by design: `interaction_limits` re-arms its expiry, every declared secret is re-sealed, and the Git LFS toggle and `check_suite_preferences` are re-sent on every apply. -Demonstrated by: [test/e2e/scenarios/apply-idempotent-unconditional.yml](https://github.com/Vivswan/github-settings-as-code/blob/main/test/e2e/scenarios/apply-idempotent-unconditional.yml), [test/src/sections/actions_variables/scenarios/actions-variables-undeclared-keep-note.yml](https://github.com/Vivswan/github-settings-as-code/blob/main/test/src/sections/actions_variables/scenarios/actions-variables-undeclared-keep-note.yml), [test/src/sections/actions_secrets/scenarios/actions-secrets-undeclared-delete.yml](https://github.com/Vivswan/github-settings-as-code/blob/main/test/src/sections/actions_secrets/scenarios/actions-secrets-undeclared-delete.yml). +Demonstrated by: [test/e2e/scenarios/apply-idempotent-unconditional.yml](https://github.com/Vivswan/github-settings-as-code/blob/main/test/e2e/scenarios/apply-idempotent-unconditional.yml), [test/sections/actions_variables/scenarios/actions-variables-undeclared-keep-note.yml](https://github.com/Vivswan/github-settings-as-code/blob/main/test/sections/actions_variables/scenarios/actions-variables-undeclared-keep-note.yml), [test/sections/actions_secrets/scenarios/actions-secrets-undeclared-delete.yml](https://github.com/Vivswan/github-settings-as-code/blob/main/test/sections/actions_secrets/scenarios/actions-secrets-undeclared-delete.yml). ## The mode ladder @@ -140,7 +140,7 @@ The success path mints the input a planner accepts: a section's `plan()` takes t Secret references are the exception. The `$NAME` syntax is judged per section when the run starts, because the verdict needs the document's provenance ([Trust and provenance](#trust-and-provenance)). -Demonstrated by: [test/engine/validate.test.ts](https://github.com/Vivswan/github-settings-as-code/blob/main/test/engine/validate.test.ts), [test/engine/orchestrate.test.ts](https://github.com/Vivswan/github-settings-as-code/blob/main/test/engine/orchestrate.test.ts), [test/src/sections/interaction_limits/scenarios/interaction-limits-invalid-values-and-unknown-key-rejected.yml](https://github.com/Vivswan/github-settings-as-code/blob/main/test/src/sections/interaction_limits/scenarios/interaction-limits-invalid-values-and-unknown-key-rejected.yml). +Demonstrated by: [test/engine/validate.test.ts](https://github.com/Vivswan/github-settings-as-code/blob/main/test/engine/validate.test.ts), [test/engine/orchestrate.test.ts](https://github.com/Vivswan/github-settings-as-code/blob/main/test/engine/orchestrate.test.ts), [test/sections/interaction_limits/scenarios/interaction-limits-invalid-values-and-unknown-key-rejected.yml](https://github.com/Vivswan/github-settings-as-code/blob/main/test/sections/interaction_limits/scenarios/interaction-limits-invalid-values-and-unknown-key-rejected.yml). ## The layering fold @@ -402,4 +402,4 @@ graph TD ``` -Each section's e2e harness fragments (`mock.ts`, `generators.ts`) are test code under `test/src/sections//`, outside the map. +Each section's e2e harness fragments (`mock.ts`, `generators.ts`) are test code under `test/sections//`, outside the map. diff --git a/test/e2e/foundation.test.ts b/test/e2e/foundation.test.ts index 1c5a7fb6..5055cdce 100644 --- a/test/e2e/foundation.test.ts +++ b/test/e2e/foundation.test.ts @@ -398,7 +398,7 @@ describe("harness identity constants", () => { // class is banned at the import boundary: a fragment always has the owning state in scope. const offenders: string[] = []; let fragments = 0; - for await (const file of new Bun.Glob("test/src/sections/*/mock.ts").scan(ROOT)) { + for await (const file of new Bun.Glob("test/sections/*/mock.ts").scan(ROOT)) { fragments++; const text = await Bun.file(join(ROOT, file)).text(); if (/from "[^"]*\/e2e\/constants\.js"/.test(text)) { diff --git a/test/e2e/gen-support.ts b/test/e2e/gen-support.ts index b007f668..87c73eb5 100644 --- a/test/e2e/gen-support.ts +++ b/test/e2e/gen-support.ts @@ -1,5 +1,5 @@ /** - * The leaf seam shared by the per-section generator fragments (test/src/sections//generators.ts) and their aggregator + * The leaf seam shared by the per-section generator fragments (test/sections//generators.ts) and their aggregator * (test/e2e/generators.ts). Like mock/support.ts, it imports no fragment and no aggregator, so the fragments depend on it without a cycle. */ diff --git a/test/e2e/generators.ts b/test/e2e/generators.ts index c65423de..7021c086 100644 --- a/test/e2e/generators.ts +++ b/test/e2e/generators.ts @@ -24,26 +24,26 @@ import { allEndpoints, allGraphqlOps, SECTIONS } from "../../src/sections/regist import { compileFailure } from "../../src/sections/secret_scanning_custom_patterns/compilable-form.js"; import { MAX_VARIABLE_VALUE_BYTES } from "../../src/sections/shared/schema-helpers.js"; import type { MustBeNever } from "../../src/types.js"; -import { genActions } from "../src/sections/actions/generators.js"; -import { autolinksWitness, genAutolinks } from "../src/sections/autolinks/generators.js"; -import { FUZZ_DEPLOYMENT_ENVIRONMENTS, genBranches } from "../src/sections/branches/generators.js"; -import { genCheckSuitePreferences } from "../src/sections/check_suite_preferences/generators.js"; -import { genCodeQuality } from "../src/sections/code_quality_setup/generators.js"; -import { genCodeScanning } from "../src/sections/code_scanning_default_setup/generators.js"; -import { genCollaborators, genInvitationsState } from "../src/sections/collaborators/generators.js"; -import { genCustomProperties } from "../src/sections/custom_properties/generators.js"; -import { deployKeysWitness, genDeployKeys } from "../src/sections/deploy_keys/generators.js"; -import { genEnvironments } from "../src/sections/environments/generators.js"; -import { genInteractionLimits } from "../src/sections/interaction_limits/generators.js"; -import { genLabels, labelsWitness } from "../src/sections/labels/generators.js"; -import { genMilestones, milestonesWitness } from "../src/sections/milestones/generators.js"; -import { genPages } from "../src/sections/pages/generators.js"; -import { genRepository } from "../src/sections/repository/generators.js"; -import { genRulesets, PULL_REQUEST_PARAMETERS } from "../src/sections/rulesets/generators.js"; -import { genSecretScanningPatterns } from "../src/sections/secret_scanning_custom_patterns/generators.js"; -import { genTeams } from "../src/sections/teams/generators.js"; -import { genWebhooks } from "../src/sections/webhooks/generators.js"; -import { genWorkflows } from "../src/sections/workflows/generators.js"; +import { genActions } from "../sections/actions/generators.js"; +import { autolinksWitness, genAutolinks } from "../sections/autolinks/generators.js"; +import { FUZZ_DEPLOYMENT_ENVIRONMENTS, genBranches } from "../sections/branches/generators.js"; +import { genCheckSuitePreferences } from "../sections/check_suite_preferences/generators.js"; +import { genCodeQuality } from "../sections/code_quality_setup/generators.js"; +import { genCodeScanning } from "../sections/code_scanning_default_setup/generators.js"; +import { genCollaborators, genInvitationsState } from "../sections/collaborators/generators.js"; +import { genCustomProperties } from "../sections/custom_properties/generators.js"; +import { deployKeysWitness, genDeployKeys } from "../sections/deploy_keys/generators.js"; +import { genEnvironments } from "../sections/environments/generators.js"; +import { genInteractionLimits } from "../sections/interaction_limits/generators.js"; +import { genLabels, labelsWitness } from "../sections/labels/generators.js"; +import { genMilestones, milestonesWitness } from "../sections/milestones/generators.js"; +import { genPages } from "../sections/pages/generators.js"; +import { genRepository } from "../sections/repository/generators.js"; +import { genRulesets, PULL_REQUEST_PARAMETERS } from "../sections/rulesets/generators.js"; +import { genSecretScanningPatterns } from "../sections/secret_scanning_custom_patterns/generators.js"; +import { genTeams } from "../sections/teams/generators.js"; +import { genWebhooks } from "../sections/webhooks/generators.js"; +import { genWorkflows } from "../sections/workflows/generators.js"; import { ADMIN_SLUG } from "./constants.js"; import { DEFAULT_LAYERING_DIRECTIVE, diff --git a/test/e2e/mock/graphql-pipeline.test.ts b/test/e2e/mock/graphql-pipeline.test.ts index 770d17fe..7ce4213f 100644 --- a/test/e2e/mock/graphql-pipeline.test.ts +++ b/test/e2e/mock/graphql-pipeline.test.ts @@ -465,7 +465,7 @@ describe("GraphQL response guard and chaos", () => { describe("assertGraphqlHandlerCompleteness", () => { test("both drift directions fail loudly", () => { expect(() => assertGraphqlHandlerCompleteness(OPS, {})).toThrow( - /GraphQL operations with no mock handler: \[repository\.gNodeId \(add it in test\/src\/sections\/repository\/mock\.ts/, + /GraphQL operations with no mock handler: \[repository\.gNodeId \(add it in test\/sections\/repository\/mock\.ts/, ); expect(() => assertGraphqlHandlerCompleteness({}, HANDLERS)).toThrow( /GraphQL handlers naming no declared operation/, diff --git a/test/e2e/mock/handlers.ts b/test/e2e/mock/handlers.ts index 4affb9f8..f176b480 100644 --- a/test/e2e/mock/handlers.ts +++ b/test/e2e/mock/handlers.ts @@ -19,7 +19,7 @@ export const GRAPHQL_HANDLERS: Record = sectionGraphqlHa function missingHandlerPointer(missing: Array<[string, { section: string }]>): string { return missing - .map(([key, { section }]) => `${key} (add it in test/src/sections/${section}/mock.ts)`) + .map(([key, { section }]) => `${key} (add it in test/sections/${section}/mock.ts)`) .sort() .join(", "); } diff --git a/test/e2e/mock/sections.ts b/test/e2e/mock/sections.ts index 78b04ca8..a56ed466 100644 --- a/test/e2e/mock/sections.ts +++ b/test/e2e/mock/sections.ts @@ -6,41 +6,38 @@ import { SECTION_KEYS, type SectionKey } from "../../../src/schema.js"; import type { SectionGraphqlKey } from "../../../src/sections/registry.js"; -import { actionsMockHandlers } from "../../src/sections/actions/mock.js"; -import { actionsSecretsMockHandlers } from "../../src/sections/actions_secrets/mock.js"; -import { actionsVariablesMockHandlers } from "../../src/sections/actions_variables/mock.js"; -import { agentsSecretsMockHandlers } from "../../src/sections/agents_secrets/mock.js"; -import { agentsVariablesMockHandlers } from "../../src/sections/agents_variables/mock.js"; -import { autolinksMockHandlers } from "../../src/sections/autolinks/mock.js"; -import { - branchesMockGraphqlHandlers, - branchesMockHandlers, -} from "../../src/sections/branches/mock.js"; -import { checkSuitePreferencesMockHandlers } from "../../src/sections/check_suite_preferences/mock.js"; -import { codeQualitySetupMockHandlers } from "../../src/sections/code_quality_setup/mock.js"; -import { codeScanningDefaultSetupMockHandlers } from "../../src/sections/code_scanning_default_setup/mock.js"; -import { codespacesSecretsMockHandlers } from "../../src/sections/codespaces_secrets/mock.js"; -import { collaboratorsMockHandlers } from "../../src/sections/collaborators/mock.js"; -import { customPropertiesMockHandlers } from "../../src/sections/custom_properties/mock.js"; -import { dependabotSecretsMockHandlers } from "../../src/sections/dependabot_secrets/mock.js"; -import { deployKeysMockHandlers } from "../../src/sections/deploy_keys/mock.js"; +import { actionsMockHandlers } from "../../sections/actions/mock.js"; +import { actionsSecretsMockHandlers } from "../../sections/actions_secrets/mock.js"; +import { actionsVariablesMockHandlers } from "../../sections/actions_variables/mock.js"; +import { agentsSecretsMockHandlers } from "../../sections/agents_secrets/mock.js"; +import { agentsVariablesMockHandlers } from "../../sections/agents_variables/mock.js"; +import { autolinksMockHandlers } from "../../sections/autolinks/mock.js"; +import { branchesMockGraphqlHandlers, branchesMockHandlers } from "../../sections/branches/mock.js"; +import { checkSuitePreferencesMockHandlers } from "../../sections/check_suite_preferences/mock.js"; +import { codeQualitySetupMockHandlers } from "../../sections/code_quality_setup/mock.js"; +import { codeScanningDefaultSetupMockHandlers } from "../../sections/code_scanning_default_setup/mock.js"; +import { codespacesSecretsMockHandlers } from "../../sections/codespaces_secrets/mock.js"; +import { collaboratorsMockHandlers } from "../../sections/collaborators/mock.js"; +import { customPropertiesMockHandlers } from "../../sections/custom_properties/mock.js"; +import { dependabotSecretsMockHandlers } from "../../sections/dependabot_secrets/mock.js"; +import { deployKeysMockHandlers } from "../../sections/deploy_keys/mock.js"; import { environmentsMockGraphqlHandlers, environmentsMockHandlers, -} from "../../src/sections/environments/mock.js"; -import { interactionLimitsMockHandlers } from "../../src/sections/interaction_limits/mock.js"; -import { labelsMockHandlers } from "../../src/sections/labels/mock.js"; -import { milestonesMockHandlers } from "../../src/sections/milestones/mock.js"; -import { pagesMockHandlers } from "../../src/sections/pages/mock.js"; +} from "../../sections/environments/mock.js"; +import { interactionLimitsMockHandlers } from "../../sections/interaction_limits/mock.js"; +import { labelsMockHandlers } from "../../sections/labels/mock.js"; +import { milestonesMockHandlers } from "../../sections/milestones/mock.js"; +import { pagesMockHandlers } from "../../sections/pages/mock.js"; import { repositoryMockGraphqlHandlers, repositoryMockHandlers, -} from "../../src/sections/repository/mock.js"; -import { rulesetsMockHandlers } from "../../src/sections/rulesets/mock.js"; -import { secretScanningCustomPatternsMockHandlers } from "../../src/sections/secret_scanning_custom_patterns/mock.js"; -import { teamsMockHandlers } from "../../src/sections/teams/mock.js"; -import { webhooksMockHandlers } from "../../src/sections/webhooks/mock.js"; -import { workflowsMockHandlers } from "../../src/sections/workflows/mock.js"; +} from "../../sections/repository/mock.js"; +import { rulesetsMockHandlers } from "../../sections/rulesets/mock.js"; +import { secretScanningCustomPatternsMockHandlers } from "../../sections/secret_scanning_custom_patterns/mock.js"; +import { teamsMockHandlers } from "../../sections/teams/mock.js"; +import { webhooksMockHandlers } from "../../sections/webhooks/mock.js"; +import { workflowsMockHandlers } from "../../sections/workflows/mock.js"; import type { GraphqlHandler, Handler, diff --git a/test/e2e/mock/server-multi.test.ts b/test/e2e/mock/server-multi.test.ts index d7c9c916..67276215 100644 --- a/test/e2e/mock/server-multi.test.ts +++ b/test/e2e/mock/server-multi.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "bun:test"; -import { TEAM_REPOSITORY_MEDIA_TYPE } from "../../src/sections/teams/mock.js"; +import { TEAM_REPOSITORY_MEDIA_TYPE } from "../../sections/teams/mock.js"; import { RAW_CONTENTS_ACCEPT } from "./core-paths.js"; import type { MockHandle } from "./server.js"; import { call, json, jsonArray, mockServerLifecycle, scenario } from "./server-test-support.js"; diff --git a/test/e2e/mock/server.test.ts b/test/e2e/mock/server.test.ts index b4e6167f..c4b274d4 100644 --- a/test/e2e/mock/server.test.ts +++ b/test/e2e/mock/server.test.ts @@ -3,7 +3,7 @@ import { GitHubApi } from "../../../src/github/api.js"; import { maskRegistry } from "../../../src/io.js"; import { endpointPermission } from "../../../src/sections/contract/module.js"; import { allEndpoints, SECTIONS } from "../../../src/sections/registry.js"; -import { TEAM_REPOSITORY_MEDIA_TYPE } from "../../src/sections/teams/mock.js"; +import { TEAM_REPOSITORY_MEDIA_TYPE } from "../../sections/teams/mock.js"; import { ADMIN_OWNER as OWNER, ADMIN_REPO as REPO } from "../constants.js"; import { assertFaultKeys } from "./chaos.js"; import { RAW_CONTENTS_ACCEPT } from "./core-paths.js"; diff --git a/test/e2e/mock/state.test.ts b/test/e2e/mock/state.test.ts index ae263722..8e00ede8 100644 --- a/test/e2e/mock/state.test.ts +++ b/test/e2e/mock/state.test.ts @@ -14,7 +14,7 @@ import { flattenProtection } from "../../../src/sections/branches/index.js"; import { flattenEnvironment } from "../../../src/sections/environments/index.js"; import { SECTIONS } from "../../../src/sections/registry.js"; import { DEFAULT_ROLE, roleForPermission } from "../../../src/sections/shared/roles.js"; -import { TEAM_REPOSITORY_MEDIA_TYPE, teamsMockHandlers } from "../../src/sections/teams/mock.js"; +import { TEAM_REPOSITORY_MEDIA_TYPE, teamsMockHandlers } from "../../sections/teams/mock.js"; import { genScenario } from "../generators.js"; import { Rng } from "../prng.js"; import { handlerTestContext } from "./handler-test-ctx.js"; diff --git a/test/e2e/mock/state.ts b/test/e2e/mock/state.ts index f2d0bc40..9c3a455d 100644 --- a/test/e2e/mock/state.ts +++ b/test/e2e/mock/state.ts @@ -22,12 +22,12 @@ import { roleForPermission, } from "../../../src/sections/shared/roles.js"; import type { MustBeNever } from "../../../src/types.js"; -import { AUTOLINKS_MOCK } from "../../src/sections/autolinks/mock.js"; -import { DEPLOY_KEYS_MOCK } from "../../src/sections/deploy_keys/mock.js"; -import { LABELS_MOCK } from "../../src/sections/labels/mock.js"; -import { MILESTONES_MOCK } from "../../src/sections/milestones/mock.js"; -import { RULESETS_MOCK } from "../../src/sections/rulesets/mock.js"; -import { WEBHOOKS_MOCK } from "../../src/sections/webhooks/mock.js"; +import { AUTOLINKS_MOCK } from "../../sections/autolinks/mock.js"; +import { DEPLOY_KEYS_MOCK } from "../../sections/deploy_keys/mock.js"; +import { LABELS_MOCK } from "../../sections/labels/mock.js"; +import { MILESTONES_MOCK } from "../../sections/milestones/mock.js"; +import { RULESETS_MOCK } from "../../sections/rulesets/mock.js"; +import { WEBHOOKS_MOCK } from "../../sections/webhooks/mock.js"; import { ADMIN_OWNER } from "../constants.js"; import orgFixture from "../fixtures/org.json" with { type: "json" }; import repoFixture from "../fixtures/repo.json" with { type: "json" }; diff --git a/test/e2e/mock/support.ts b/test/e2e/mock/support.ts index 5a37fc15..95473048 100644 --- a/test/e2e/mock/support.ts +++ b/test/e2e/mock/support.ts @@ -1,7 +1,7 @@ /** * Shared building blocks for the mock's per-endpoint handlers. This module sits at the BOTTOM of the * mock's layering: the pipeline, the core-path and merged handler tables, and every section fragment - * (test/src/sections//mock.ts) import it and it imports none of them, so a fragment can depend on it + * (test/sections//mock.ts) import it and it imports none of them, so a fragment can depend on it * without pulling the whole pipeline in. */ diff --git a/test/e2e/schema.ts b/test/e2e/schema.ts index f78ddf20..71b68bff 100644 --- a/test/e2e/schema.ts +++ b/test/e2e/schema.ts @@ -593,9 +593,7 @@ export function collectYmlFiles(dir: string): string[] { * test/e2e/scenarios/ -> multi-section flows; a scenario exercising ONE section lives with that section * //scenarios/ -> every registered section, so a new section's first scenario needs no list edit */ -export function scenarioRoots( - sectionsDir: string = join(ROOT, "test", "src", "sections"), -): string[] { +export function scenarioRoots(sectionsDir: string = join(ROOT, "test", "sections")): string[] { return [ join(import.meta.dir, "scenarios"), ...SECTION_KEYS.map((key) => join(sectionsDir, key, "scenarios")), diff --git a/test/schema-corpus.test.ts b/test/schema-corpus.test.ts index 903508f7..988e91c8 100644 --- a/test/schema-corpus.test.ts +++ b/test/schema-corpus.test.ts @@ -41,7 +41,7 @@ interface ScenarioFragment extends CorpusDoc { * directory, plus the cross-section root) so a root that scenarioRoots() drops is caught. */ function independentScenarioRoots(): string[] { - const sectionsDir = join(ROOT, "test", "src", "sections"); + const sectionsDir = join(ROOT, "test", "sections"); const sectionRoots = readdirSync(sectionsDir, { withFileTypes: true }) .filter( (entry) => entry.isDirectory() && existsSync(join(sectionsDir, entry.name, "scenarios")), diff --git a/test/scripts/changed-sections.test.ts b/test/scripts/changed-sections.test.ts index 36915877..64a6a775 100644 --- a/test/scripts/changed-sections.test.ts +++ b/test/scripts/changed-sections.test.ts @@ -238,10 +238,10 @@ describe("changed-sections derived fan-out", () => { }); describe("changed-sections file map", () => { - test("every path on disk under src/sections, test/src/sections, and docs/sections resolves through some selector rule", () => { + test("every path on disk under src/sections, test/sections, and docs/sections resolves through some selector rule", () => { const paths = [ ...sectionsPathsOnDisk(), - ...sectionsPathsOnDisk(join(ROOT, "test", "src", "sections"), "test/src/sections"), + ...sectionsPathsOnDisk(join(ROOT, "test", "sections"), "test/sections"), ...sectionsPathsOnDisk(join(ROOT, "docs", "sections"), "docs/sections"), "docs/schema.docs.yml", ]; @@ -288,13 +288,13 @@ describe("changed-sections selection", () => { test.each<[label: string, rendered: string, files: string[]]>([ ["a docs-only change", "none", ["README.md", "COVERAGE.md", ".github/workflows/ci.yml"]], ["a section's entry", "labels", ["src/sections/labels/index.ts"]], - ["a section's mock", "labels", ["test/src/sections/labels/mock.ts"]], - ["a section's generators", "labels", ["test/src/sections/labels/generators.ts"]], - ["a section's unit test", "labels", ["test/src/sections/labels/labels.test.ts"]], + ["a section's mock", "labels", ["test/sections/labels/mock.ts"]], + ["a section's generators", "labels", ["test/sections/labels/generators.ts"]], + ["a section's unit test", "labels", ["test/sections/labels/labels.test.ts"]], [ "a section's scenario", "environments", - ["test/src/sections/environments/scenarios/environments-apply.yml"], + ["test/sections/environments/scenarios/environments-apply.yml"], ], ["a section's docs prose", "labels", ["docs/sections/labels.docs.yml"]], [ @@ -305,12 +305,22 @@ describe("changed-sections selection", () => { [ "a mirrored key carrying underscores", "secret_scanning_custom_patterns", - ["test/src/sections/secret_scanning_custom_patterns/mock.ts"], + ["test/sections/secret_scanning_custom_patterns/mock.ts"], ], [ "multiple section directories, which union in SECTION_KEYS order", "labels,milestones", - ["src/sections/milestones/index.ts", "test/src/sections/labels/labels.test.ts"], + ["src/sections/milestones/index.ts", "test/sections/labels/labels.test.ts"], + ], + // The suites and fixtures beside the mirrors are cross-section: they select none, as they did before the mirrors joined them. + [ + "a cross-section suite, helper, and fixture beside the mirrors", + "none", + [ + "test/sections/contract.test.ts", + "test/sections/section-run.ts", + "test/sections/snapshot-rows/labels.ts", + ], ], ["registry.ts", "all", ["src/sections/registry.ts"]], ["the shared docs prose, like the docs registry", "none", ["docs/sections/shared.docs.yml"]], @@ -374,11 +384,20 @@ describe("changed-sections selection", () => { ), ).toBe("collaborators,teams"); // A deleted scenario can leave a route cold, so its section still runs. + expect( + renderSelection(sectionsForFiles(removed("test/sections/labels/scenarios/labels-apply.yml"))), + ).toBe("labels"); + // The CLI diffs with --no-renames, so folding a flat suite into its directory is a D plus an A: the deletion is + // no misplaced file and the added file carries the section. expect( renderSelection( - sectionsForFiles(removed("test/src/sections/labels/scenarios/labels-apply.yml")), + sectionsForFiles([ + ...removed("test/sections/labels-schema.test.ts"), + ...changed("test/sections/labels/schema.test.ts"), + ]), ), ).toBe("labels"); + expect(renderSelection(sectionsForFiles(removed("test/sections/labels.test.ts")))).toBe("none"); expect(sectionsForFiles(removed("src/sections/registry.ts")).kind).toBe("all"); expect(() => sectionsForFiles(removed("src/sections/labels.ts"))).toThrow( /matches no selector rule/, @@ -413,8 +432,8 @@ describe("changed-sections selection", () => { })); test("parseNameStatus reads NUL-delimited records raw and throws on any other shape", () => { - // -z keeps a path with a tab, a quote, and a backslash verbatim; git would C-quote it otherwise and the test/src/sections/ prefix would go unmatched. - const odd = 'test/src/sections/labels/scenarios/tab\there "quoted" back\\slash.yml'; + // -z keeps a path with a tab, a quote, and a backslash verbatim; git would C-quote it otherwise and the test/sections/ prefix would go unmatched. + const odd = 'test/sections/labels/scenarios/tab\there "quoted" back\\slash.yml'; expect( parseNameStatus( `A\0src/sections/labels/index.ts\0M\0README.md\0D\0src/sections/shared/roles.ts\0T\0lib/settings.schema.json\0M\0${odd}\0`, @@ -442,18 +461,25 @@ describe("changed-sections selection", () => { }); test("an unrecognized section-shaped path throws instead of silently selecting nothing, even beside a cross-cutting path", () => { - // registry.ts and docs-registry.ts are the only flat files the layout allows; a section directory must spell its - // key under src/sections/ and test/src/sections/ alike; under shared/ only mapped .ts files are known; docs/sections/ - // holds .docs.yml and shared.docs.yml and nothing else. + // registry.ts and docs-registry.ts are the only flat files src/sections/ allows; a section directory must spell its + // key under src/sections/ and test/sections/ alike; a flat file under test/sections/ named after a section is + // misplaced; under shared/ only mapped .ts files are known; docs/sections/ holds .docs.yml and + // shared.docs.yml and nothing else. for (const stray of [ "src/sections/labels.ts", "src/sections/not_a_key/index.ts", "src/sections/shared/unmapped.ts", "src/sections/shared/notes.yml", "src/sections/shared/shared.docs.yml", - "test/src/sections/labels.test.ts", - "test/src/sections/not_a_key/mock.ts", - "test/src/sections/shared/helper.ts", + "test/sections/label/mock.ts", + "test/sections/not_a_key/scenarios/x.yml", + "test/sections/shared/helper.ts", + "test/sections/labels.test.ts", + "test/sections/labels-schema.test.ts", + "test/sections/secret-scanning-custom-patterns-schema.test.ts", + "test/sections/actions_secrets.ts", + "test/sections/interaction_limits_schema.test.ts", + "test/sections/interaction-limits_schema.test.ts", "docs/sections/labels.md", "docs/sections/not_a_key.docs.yml", "docs/sections/labels/labels.docs.yml", diff --git a/test/src/sections/actions/actions.test.ts b/test/sections/actions/actions.test.ts similarity index 97% rename from test/src/sections/actions/actions.test.ts rename to test/sections/actions/actions.test.ts index 4b87f4cc..96123907 100644 --- a/test/src/sections/actions/actions.test.ts +++ b/test/sections/actions/actions.test.ts @@ -1,24 +1,24 @@ import { describe, expect, test } from "bun:test"; import { z } from "zod"; -import { validateSectionShapes } from "../../../../src/engine/validate.js"; -import type { GitHubClient } from "../../../../src/github/api.js"; -import { describeProblem } from "../../../../src/problem.js"; -import { actionsSection, endpointRouted } from "../../../../src/sections/actions/index.js"; +import { validateSectionShapes } from "../../../src/engine/validate.js"; +import type { GitHubClient } from "../../../src/github/api.js"; +import { describeProblem } from "../../../src/problem.js"; +import { actionsSection, endpointRouted } from "../../../src/sections/actions/index.js"; // The `as ActionsConfig` casts below simulate keys GitHub adds: the shape passes unknown keys through verbatim, which the static config type cannot // spell without giving up typo-checking on the known keys. -import type { ActionsConfig } from "../../../../src/sections/actions/schema.js"; -import { type SectionInput, sectionGrant } from "../../../../src/sections/contract/module.js"; -import { grantFor } from "../../../../src/sections/contract/permissions.js"; +import type { ActionsConfig } from "../../../src/sections/actions/schema.js"; +import { type SectionInput, sectionGrant } from "../../../src/sections/contract/module.js"; +import { grantFor } from "../../../src/sections/contract/permissions.js"; import { driftOf, type OnMissingPermission, planContext, snapshotContext, -} from "../../../../src/sections/contract/plan.js"; -import { MockApi } from "../../../mock-api.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +} from "../../../src/sections/contract/plan.js"; +import { MockApi } from "../../mock-api.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; function shapeError(doc: Record, sourceLabel: string): string | null { return validateSectionShapes(doc, sourceLabel).match(() => null, describeProblem); diff --git a/test/src/sections/actions/generators.ts b/test/sections/actions/generators.ts similarity index 96% rename from test/src/sections/actions/generators.ts rename to test/sections/actions/generators.ts index c5764bfb..e0e8076b 100644 --- a/test/src/sections/actions/generators.ts +++ b/test/sections/actions/generators.ts @@ -2,8 +2,8 @@ * The actions fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import type { Json } from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +import type { Json } from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; export function genActions(rng: Rng): Json { // oidc_customization_sub is NEVER generated here: its endpoints carry a per-endpoint permission diff --git a/test/src/sections/actions/mock.ts b/test/sections/actions/mock.ts similarity index 99% rename from test/src/sections/actions/mock.ts rename to test/sections/actions/mock.ts index bcb7db9e..fdaf5224 100644 --- a/test/src/sections/actions/mock.ts +++ b/test/sections/actions/mock.ts @@ -2,7 +2,7 @@ * The actions e2e mock fragment (registered in test/e2e/mock/sections.ts). */ -import { asObject, noContent, ok, type SectionRestHandlers } from "../../../e2e/mock/support.js"; +import { asObject, noContent, ok, type SectionRestHandlers } from "../../e2e/mock/support.js"; export const actionsMockHandlers: SectionRestHandlers<"actions"> = { "actions.getPermissions": ({ state }) => ok(state.actions_permissions), diff --git a/test/src/sections/actions/scenarios/actions-apply-converges.yml b/test/sections/actions/scenarios/actions-apply-converges.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-apply-converges.yml rename to test/sections/actions/scenarios/actions-apply-converges.yml diff --git a/test/src/sections/actions/scenarios/actions-cache-limits-apply-converges.yml b/test/sections/actions/scenarios/actions-cache-limits-apply-converges.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-cache-limits-apply-converges.yml rename to test/sections/actions/scenarios/actions-cache-limits-apply-converges.yml diff --git a/test/src/sections/actions/scenarios/actions-cache-limits-check-drift.yml b/test/sections/actions/scenarios/actions-cache-limits-check-drift.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-cache-limits-check-drift.yml rename to test/sections/actions/scenarios/actions-cache-limits-check-drift.yml diff --git a/test/src/sections/actions/scenarios/actions-cache-unknown-key-rejected.yml b/test/sections/actions/scenarios/actions-cache-unknown-key-rejected.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-cache-unknown-key-rejected.yml rename to test/sections/actions/scenarios/actions-cache-unknown-key-rejected.yml diff --git a/test/src/sections/actions/scenarios/actions-check-drift.yml b/test/sections/actions/scenarios/actions-check-drift.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-check-drift.yml rename to test/sections/actions/scenarios/actions-check-drift.yml diff --git a/test/src/sections/actions/scenarios/actions-every-parse-error-one-run.yml b/test/sections/actions/scenarios/actions-every-parse-error-one-run.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-every-parse-error-one-run.yml rename to test/sections/actions/scenarios/actions-every-parse-error-one-run.yml diff --git a/test/src/sections/actions/scenarios/actions-fork-pr-apply-converges.yml b/test/sections/actions/scenarios/actions-fork-pr-apply-converges.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-fork-pr-apply-converges.yml rename to test/sections/actions/scenarios/actions-fork-pr-apply-converges.yml diff --git a/test/src/sections/actions/scenarios/actions-fork-pr-check-drift.yml b/test/sections/actions/scenarios/actions-fork-pr-check-drift.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-fork-pr-check-drift.yml rename to test/sections/actions/scenarios/actions-fork-pr-check-drift.yml diff --git a/test/src/sections/actions/scenarios/actions-oidc-actions-denied.yml b/test/sections/actions/scenarios/actions-oidc-actions-denied.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-oidc-actions-denied.yml rename to test/sections/actions/scenarios/actions-oidc-actions-denied.yml diff --git a/test/src/sections/actions/scenarios/actions-oidc-administration-denied-still-reads.yml b/test/sections/actions/scenarios/actions-oidc-administration-denied-still-reads.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-oidc-administration-denied-still-reads.yml rename to test/sections/actions/scenarios/actions-oidc-administration-denied-still-reads.yml diff --git a/test/src/sections/actions/scenarios/actions-oidc-sub-apply-converges.yml b/test/sections/actions/scenarios/actions-oidc-sub-apply-converges.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-oidc-sub-apply-converges.yml rename to test/sections/actions/scenarios/actions-oidc-sub-apply-converges.yml diff --git a/test/src/sections/actions/scenarios/actions-oidc-sub-check-drift.yml b/test/sections/actions/scenarios/actions-oidc-sub-check-drift.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-oidc-sub-check-drift.yml rename to test/sections/actions/scenarios/actions-oidc-sub-check-drift.yml diff --git a/test/src/sections/actions/scenarios/actions-retention-apply-converges.yml b/test/sections/actions/scenarios/actions-retention-apply-converges.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-retention-apply-converges.yml rename to test/sections/actions/scenarios/actions-retention-apply-converges.yml diff --git a/test/src/sections/actions/scenarios/actions-retention-check-drift.yml b/test/sections/actions/scenarios/actions-retention-check-drift.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-retention-check-drift.yml rename to test/sections/actions/scenarios/actions-retention-check-drift.yml diff --git a/test/src/sections/actions/scenarios/actions-retention-reported-field-rejected.yml b/test/sections/actions/scenarios/actions-retention-reported-field-rejected.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-retention-reported-field-rejected.yml rename to test/sections/actions/scenarios/actions-retention-reported-field-rejected.yml diff --git a/test/src/sections/actions/scenarios/actions-routed-unknown-key-noted.yml b/test/sections/actions/scenarios/actions-routed-unknown-key-noted.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-routed-unknown-key-noted.yml rename to test/sections/actions/scenarios/actions-routed-unknown-key-noted.yml diff --git a/test/src/sections/actions/scenarios/actions-selected-apply-converges.yml b/test/sections/actions/scenarios/actions-selected-apply-converges.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-selected-apply-converges.yml rename to test/sections/actions/scenarios/actions-selected-apply-converges.yml diff --git a/test/src/sections/actions/scenarios/actions-selected-check-drift.yml b/test/sections/actions/scenarios/actions-selected-check-drift.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-selected-check-drift.yml rename to test/sections/actions/scenarios/actions-selected-check-drift.yml diff --git a/test/src/sections/actions/scenarios/actions-selected-contradiction-rejected-check.yml b/test/sections/actions/scenarios/actions-selected-contradiction-rejected-check.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-selected-contradiction-rejected-check.yml rename to test/sections/actions/scenarios/actions-selected-contradiction-rejected-check.yml diff --git a/test/src/sections/actions/scenarios/actions-selected-contradiction-rejected.yml b/test/sections/actions/scenarios/actions-selected-contradiction-rejected.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-selected-contradiction-rejected.yml rename to test/sections/actions/scenarios/actions-selected-contradiction-rejected.yml diff --git a/test/src/sections/actions/scenarios/actions-sha-pinning-apply-converges.yml b/test/sections/actions/scenarios/actions-sha-pinning-apply-converges.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-sha-pinning-apply-converges.yml rename to test/sections/actions/scenarios/actions-sha-pinning-apply-converges.yml diff --git a/test/src/sections/actions/scenarios/actions-snapshot-oidc-denied-fails.yml b/test/sections/actions/scenarios/actions-snapshot-oidc-denied-fails.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-snapshot-oidc-denied-fails.yml rename to test/sections/actions/scenarios/actions-snapshot-oidc-denied-fails.yml diff --git a/test/src/sections/actions/scenarios/actions-snapshot-oidc-denied-warn.yml b/test/sections/actions/scenarios/actions-snapshot-oidc-denied-warn.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-snapshot-oidc-denied-warn.yml rename to test/sections/actions/scenarios/actions-snapshot-oidc-denied-warn.yml diff --git a/test/src/sections/actions/scenarios/actions-snapshot-roundtrip.yml b/test/sections/actions/scenarios/actions-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-snapshot-roundtrip.yml rename to test/sections/actions/scenarios/actions-snapshot-roundtrip.yml diff --git a/test/src/sections/actions/scenarios/actions-workflow-access-apply-converges.yml b/test/sections/actions/scenarios/actions-workflow-access-apply-converges.yml similarity index 100% rename from test/src/sections/actions/scenarios/actions-workflow-access-apply-converges.yml rename to test/sections/actions/scenarios/actions-workflow-access-apply-converges.yml diff --git a/test/src/sections/actions_secrets/actions_secrets.test.ts b/test/sections/actions_secrets/actions_secrets.test.ts similarity index 96% rename from test/src/sections/actions_secrets/actions_secrets.test.ts rename to test/sections/actions_secrets/actions_secrets.test.ts index c26050a9..a94f21db 100644 --- a/test/src/sections/actions_secrets/actions_secrets.test.ts +++ b/test/sections/actions_secrets/actions_secrets.test.ts @@ -1,18 +1,18 @@ import { describe, expect, test } from "bun:test"; -import { executePlan } from "../../../../src/engine/execute.js"; -import { type GitHubClient, SECRET_RESPONSE_WITHHELD } from "../../../../src/github/api.js"; -import { actionsSecretsSection } from "../../../../src/sections/actions_secrets/index.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { driftOf, type ExecTools, planContext } from "../../../../src/sections/contract/plan.js"; +import { executePlan } from "../../../src/engine/execute.js"; +import { type GitHubClient, SECRET_RESPONSE_WITHHELD } from "../../../src/github/api.js"; +import { actionsSecretsSection } from "../../../src/sections/actions_secrets/index.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { driftOf, type ExecTools, planContext } from "../../../src/sections/contract/plan.js"; import { MOCK_SECRETS_PUBLIC_KEY, mockSodiumReady, unsealSecretValue, -} from "../../../e2e/mock/secrets.js"; -import { MockApi } from "../../../mock-api.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +} from "../../e2e/mock/secrets.js"; +import { MockApi } from "../../mock-api.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; const LIST = "GET /repos/o/r/actions/secrets?per_page=100&page=1"; const PUBLIC_KEY = "GET /repos/o/r/actions/secrets/public-key"; diff --git a/test/src/sections/actions_secrets/mock.ts b/test/sections/actions_secrets/mock.ts similarity index 90% rename from test/src/sections/actions_secrets/mock.ts rename to test/sections/actions_secrets/mock.ts index 53aa608a..53928f46 100644 --- a/test/src/sections/actions_secrets/mock.ts +++ b/test/sections/actions_secrets/mock.ts @@ -3,7 +3,7 @@ * test/e2e/mock/support.ts. */ -import { repoSecretsRestHandlers, type SectionRestHandlers } from "../../../e2e/mock/support.js"; +import { repoSecretsRestHandlers, type SectionRestHandlers } from "../../e2e/mock/support.js"; export const actionsSecretsMockHandlers: SectionRestHandlers<"actions_secrets"> = repoSecretsRestHandlers("actions_secrets"); diff --git a/test/src/sections/actions_secrets/scenarios/actions-secrets-apply-converges.yml b/test/sections/actions_secrets/scenarios/actions-secrets-apply-converges.yml similarity index 100% rename from test/src/sections/actions_secrets/scenarios/actions-secrets-apply-converges.yml rename to test/sections/actions_secrets/scenarios/actions-secrets-apply-converges.yml diff --git a/test/src/sections/actions_secrets/scenarios/actions-secrets-check-drift.yml b/test/sections/actions_secrets/scenarios/actions-secrets-check-drift.yml similarity index 100% rename from test/src/sections/actions_secrets/scenarios/actions-secrets-check-drift.yml rename to test/sections/actions_secrets/scenarios/actions-secrets-check-drift.yml diff --git a/test/src/sections/actions_secrets/scenarios/actions-secrets-empty-purge.yml b/test/sections/actions_secrets/scenarios/actions-secrets-empty-purge.yml similarity index 100% rename from test/src/sections/actions_secrets/scenarios/actions-secrets-empty-purge.yml rename to test/sections/actions_secrets/scenarios/actions-secrets-empty-purge.yml diff --git a/test/src/sections/actions_secrets/scenarios/actions-secrets-excluded-literal-value-rejected.yml b/test/sections/actions_secrets/scenarios/actions-secrets-excluded-literal-value-rejected.yml similarity index 100% rename from test/src/sections/actions_secrets/scenarios/actions-secrets-excluded-literal-value-rejected.yml rename to test/sections/actions_secrets/scenarios/actions-secrets-excluded-literal-value-rejected.yml diff --git a/test/src/sections/actions_secrets/scenarios/actions-secrets-literal-value-rejected.yml b/test/sections/actions_secrets/scenarios/actions-secrets-literal-value-rejected.yml similarity index 100% rename from test/src/sections/actions_secrets/scenarios/actions-secrets-literal-value-rejected.yml rename to test/sections/actions_secrets/scenarios/actions-secrets-literal-value-rejected.yml diff --git a/test/src/sections/actions_secrets/scenarios/actions-secrets-name-rejected.yml b/test/sections/actions_secrets/scenarios/actions-secrets-name-rejected.yml similarity index 100% rename from test/src/sections/actions_secrets/scenarios/actions-secrets-name-rejected.yml rename to test/sections/actions_secrets/scenarios/actions-secrets-name-rejected.yml diff --git a/test/src/sections/actions_secrets/scenarios/actions-secrets-snapshot-roundtrip.yml b/test/sections/actions_secrets/scenarios/actions-secrets-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/actions_secrets/scenarios/actions-secrets-snapshot-roundtrip.yml rename to test/sections/actions_secrets/scenarios/actions-secrets-snapshot-roundtrip.yml diff --git a/test/src/sections/actions_secrets/scenarios/actions-secrets-undeclared-delete.yml b/test/sections/actions_secrets/scenarios/actions-secrets-undeclared-delete.yml similarity index 100% rename from test/src/sections/actions_secrets/scenarios/actions-secrets-undeclared-delete.yml rename to test/sections/actions_secrets/scenarios/actions-secrets-undeclared-delete.yml diff --git a/test/src/sections/actions_secrets/scenarios/actions-secrets-undeclared-keep-note.yml b/test/sections/actions_secrets/scenarios/actions-secrets-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/actions_secrets/scenarios/actions-secrets-undeclared-keep-note.yml rename to test/sections/actions_secrets/scenarios/actions-secrets-undeclared-keep-note.yml diff --git a/test/src/sections/actions_variables/actions_variables.test.ts b/test/sections/actions_variables/actions_variables.test.ts similarity index 93% rename from test/src/sections/actions_variables/actions_variables.test.ts rename to test/sections/actions_variables/actions_variables.test.ts index fe0b7982..3e550679 100644 --- a/test/src/sections/actions_variables/actions_variables.test.ts +++ b/test/sections/actions_variables/actions_variables.test.ts @@ -1,14 +1,14 @@ import { describe, expect, test } from "bun:test"; -import { executePlan } from "../../../../src/engine/execute.js"; -import type { GitHubClient } from "../../../../src/github/api.js"; -import { actionsVariablesSection } from "../../../../src/sections/actions_variables/index.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { planContext } from "../../../../src/sections/contract/plan.js"; -import { variableKey } from "../../../../src/sections/shared/variables-engine.js"; -import { MockApi } from "../../../mock-api.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import { executePlan } from "../../../src/engine/execute.js"; +import type { GitHubClient } from "../../../src/github/api.js"; +import { actionsVariablesSection } from "../../../src/sections/actions_variables/index.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { planContext } from "../../../src/sections/contract/plan.js"; +import { variableKey } from "../../../src/sections/shared/variables-engine.js"; +import { MockApi } from "../../mock-api.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; type Declared = SectionInput<"actions_variables">; diff --git a/test/src/sections/actions_variables/mock.ts b/test/sections/actions_variables/mock.ts similarity index 71% rename from test/src/sections/actions_variables/mock.ts rename to test/sections/actions_variables/mock.ts index de76d419..e71c5752 100644 --- a/test/src/sections/actions_variables/mock.ts +++ b/test/sections/actions_variables/mock.ts @@ -3,8 +3,8 @@ * test/e2e/mock/support.ts. */ -import { actionsVariablesSection } from "../../../../src/sections/actions_variables/index.js"; -import { repoVariablesRestHandlers, type SectionRestHandlers } from "../../../e2e/mock/support.js"; +import { actionsVariablesSection } from "../../../src/sections/actions_variables/index.js"; +import { repoVariablesRestHandlers, type SectionRestHandlers } from "../../e2e/mock/support.js"; export const actionsVariablesMockHandlers: SectionRestHandlers<"actions_variables"> = repoVariablesRestHandlers(actionsVariablesSection); diff --git a/test/src/sections/actions_variables/scenarios/actions-variables-apply-converges.yml b/test/sections/actions_variables/scenarios/actions-variables-apply-converges.yml similarity index 100% rename from test/src/sections/actions_variables/scenarios/actions-variables-apply-converges.yml rename to test/sections/actions_variables/scenarios/actions-variables-apply-converges.yml diff --git a/test/src/sections/actions_variables/scenarios/actions-variables-check-drift.yml b/test/sections/actions_variables/scenarios/actions-variables-check-drift.yml similarity index 100% rename from test/src/sections/actions_variables/scenarios/actions-variables-check-drift.yml rename to test/sections/actions_variables/scenarios/actions-variables-check-drift.yml diff --git a/test/src/sections/actions_variables/scenarios/actions-variables-name-rejected.yml b/test/sections/actions_variables/scenarios/actions-variables-name-rejected.yml similarity index 100% rename from test/src/sections/actions_variables/scenarios/actions-variables-name-rejected.yml rename to test/sections/actions_variables/scenarios/actions-variables-name-rejected.yml diff --git a/test/src/sections/actions_variables/scenarios/actions-variables-snapshot-roundtrip.yml b/test/sections/actions_variables/scenarios/actions-variables-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/actions_variables/scenarios/actions-variables-snapshot-roundtrip.yml rename to test/sections/actions_variables/scenarios/actions-variables-snapshot-roundtrip.yml diff --git a/test/src/sections/actions_variables/scenarios/actions-variables-undeclared-delete.yml b/test/sections/actions_variables/scenarios/actions-variables-undeclared-delete.yml similarity index 100% rename from test/src/sections/actions_variables/scenarios/actions-variables-undeclared-delete.yml rename to test/sections/actions_variables/scenarios/actions-variables-undeclared-delete.yml diff --git a/test/src/sections/actions_variables/scenarios/actions-variables-undeclared-keep-note.yml b/test/sections/actions_variables/scenarios/actions-variables-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/actions_variables/scenarios/actions-variables-undeclared-keep-note.yml rename to test/sections/actions_variables/scenarios/actions-variables-undeclared-keep-note.yml diff --git a/test/src/sections/agents_secrets/mock.ts b/test/sections/agents_secrets/mock.ts similarity index 90% rename from test/src/sections/agents_secrets/mock.ts rename to test/sections/agents_secrets/mock.ts index 3118d1c7..e113a8df 100644 --- a/test/src/sections/agents_secrets/mock.ts +++ b/test/sections/agents_secrets/mock.ts @@ -3,7 +3,7 @@ * test/e2e/mock/support.ts. */ -import { repoSecretsRestHandlers, type SectionRestHandlers } from "../../../e2e/mock/support.js"; +import { repoSecretsRestHandlers, type SectionRestHandlers } from "../../e2e/mock/support.js"; export const agentsSecretsMockHandlers: SectionRestHandlers<"agents_secrets"> = repoSecretsRestHandlers("agents_secrets"); diff --git a/test/src/sections/agents_secrets/scenarios/agents-secrets-apply-converges.yml b/test/sections/agents_secrets/scenarios/agents-secrets-apply-converges.yml similarity index 100% rename from test/src/sections/agents_secrets/scenarios/agents-secrets-apply-converges.yml rename to test/sections/agents_secrets/scenarios/agents-secrets-apply-converges.yml diff --git a/test/src/sections/agents_secrets/scenarios/agents-secrets-check-drift.yml b/test/sections/agents_secrets/scenarios/agents-secrets-check-drift.yml similarity index 100% rename from test/src/sections/agents_secrets/scenarios/agents-secrets-check-drift.yml rename to test/sections/agents_secrets/scenarios/agents-secrets-check-drift.yml diff --git a/test/src/sections/agents_secrets/scenarios/agents-secrets-name-rejected.yml b/test/sections/agents_secrets/scenarios/agents-secrets-name-rejected.yml similarity index 100% rename from test/src/sections/agents_secrets/scenarios/agents-secrets-name-rejected.yml rename to test/sections/agents_secrets/scenarios/agents-secrets-name-rejected.yml diff --git a/test/src/sections/agents_secrets/scenarios/agents-secrets-snapshot-roundtrip.yml b/test/sections/agents_secrets/scenarios/agents-secrets-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/agents_secrets/scenarios/agents-secrets-snapshot-roundtrip.yml rename to test/sections/agents_secrets/scenarios/agents-secrets-snapshot-roundtrip.yml diff --git a/test/src/sections/agents_secrets/scenarios/agents-secrets-undeclared-delete.yml b/test/sections/agents_secrets/scenarios/agents-secrets-undeclared-delete.yml similarity index 100% rename from test/src/sections/agents_secrets/scenarios/agents-secrets-undeclared-delete.yml rename to test/sections/agents_secrets/scenarios/agents-secrets-undeclared-delete.yml diff --git a/test/src/sections/agents_secrets/scenarios/agents-secrets-undeclared-keep-note.yml b/test/sections/agents_secrets/scenarios/agents-secrets-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/agents_secrets/scenarios/agents-secrets-undeclared-keep-note.yml rename to test/sections/agents_secrets/scenarios/agents-secrets-undeclared-keep-note.yml diff --git a/test/src/sections/agents_variables/agents_variables.test.ts b/test/sections/agents_variables/agents_variables.test.ts similarity index 86% rename from test/src/sections/agents_variables/agents_variables.test.ts rename to test/sections/agents_variables/agents_variables.test.ts index ff2131f5..676dfab7 100644 --- a/test/src/sections/agents_variables/agents_variables.test.ts +++ b/test/sections/agents_variables/agents_variables.test.ts @@ -2,12 +2,12 @@ // section's routes, noun, and delete-by-default posture. import { describe, expect, test } from "bun:test"; -import { executePlan } from "../../../../src/engine/execute.js"; -import { agentsVariablesSection } from "../../../../src/sections/agents_variables/index.js"; -import { planContext } from "../../../../src/sections/contract/plan.js"; -import { MockApi } from "../../../mock-api.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import { executePlan } from "../../../src/engine/execute.js"; +import { agentsVariablesSection } from "../../../src/sections/agents_variables/index.js"; +import { planContext } from "../../../src/sections/contract/plan.js"; +import { MockApi } from "../../mock-api.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; describe("agents_variables", () => { const listRoute = { diff --git a/test/src/sections/agents_variables/mock.ts b/test/sections/agents_variables/mock.ts similarity index 72% rename from test/src/sections/agents_variables/mock.ts rename to test/sections/agents_variables/mock.ts index d77f807b..d0a551ea 100644 --- a/test/src/sections/agents_variables/mock.ts +++ b/test/sections/agents_variables/mock.ts @@ -3,8 +3,8 @@ * test/e2e/mock/support.ts. */ -import { agentsVariablesSection } from "../../../../src/sections/agents_variables/index.js"; -import { repoVariablesRestHandlers, type SectionRestHandlers } from "../../../e2e/mock/support.js"; +import { agentsVariablesSection } from "../../../src/sections/agents_variables/index.js"; +import { repoVariablesRestHandlers, type SectionRestHandlers } from "../../e2e/mock/support.js"; export const agentsVariablesMockHandlers: SectionRestHandlers<"agents_variables"> = repoVariablesRestHandlers(agentsVariablesSection); diff --git a/test/src/sections/agents_variables/scenarios/agents-variables-apply-converges.yml b/test/sections/agents_variables/scenarios/agents-variables-apply-converges.yml similarity index 100% rename from test/src/sections/agents_variables/scenarios/agents-variables-apply-converges.yml rename to test/sections/agents_variables/scenarios/agents-variables-apply-converges.yml diff --git a/test/src/sections/agents_variables/scenarios/agents-variables-check-drift.yml b/test/sections/agents_variables/scenarios/agents-variables-check-drift.yml similarity index 100% rename from test/src/sections/agents_variables/scenarios/agents-variables-check-drift.yml rename to test/sections/agents_variables/scenarios/agents-variables-check-drift.yml diff --git a/test/src/sections/agents_variables/scenarios/agents-variables-name-rejected.yml b/test/sections/agents_variables/scenarios/agents-variables-name-rejected.yml similarity index 100% rename from test/src/sections/agents_variables/scenarios/agents-variables-name-rejected.yml rename to test/sections/agents_variables/scenarios/agents-variables-name-rejected.yml diff --git a/test/src/sections/agents_variables/scenarios/agents-variables-snapshot-roundtrip.yml b/test/sections/agents_variables/scenarios/agents-variables-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/agents_variables/scenarios/agents-variables-snapshot-roundtrip.yml rename to test/sections/agents_variables/scenarios/agents-variables-snapshot-roundtrip.yml diff --git a/test/src/sections/agents_variables/scenarios/agents-variables-undeclared-delete.yml b/test/sections/agents_variables/scenarios/agents-variables-undeclared-delete.yml similarity index 100% rename from test/src/sections/agents_variables/scenarios/agents-variables-undeclared-delete.yml rename to test/sections/agents_variables/scenarios/agents-variables-undeclared-delete.yml diff --git a/test/src/sections/agents_variables/scenarios/agents-variables-undeclared-keep-note.yml b/test/sections/agents_variables/scenarios/agents-variables-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/agents_variables/scenarios/agents-variables-undeclared-keep-note.yml rename to test/sections/agents_variables/scenarios/agents-variables-undeclared-keep-note.yml diff --git a/test/src/sections/autolinks/autolinks.test.ts b/test/sections/autolinks/autolinks.test.ts similarity index 94% rename from test/src/sections/autolinks/autolinks.test.ts rename to test/sections/autolinks/autolinks.test.ts index 0e9b8fc7..281c8a83 100644 --- a/test/src/sections/autolinks/autolinks.test.ts +++ b/test/sections/autolinks/autolinks.test.ts @@ -1,12 +1,12 @@ import { describe, expect, test } from "bun:test"; -import { autolinksSection } from "../../../../src/sections/autolinks/index.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { planContext } from "../../../../src/sections/contract/plan.js"; -import { MockApi } from "../../../mock-api.js"; -import { fragmentFake } from "../../../sections/fragment-fake.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import { autolinksSection } from "../../../src/sections/autolinks/index.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { planContext } from "../../../src/sections/contract/plan.js"; +import { MockApi } from "../../mock-api.js"; +import { fragmentFake } from "../fragment-fake.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; import { autolinksMockHandlers } from "./mock.js"; /** The list is unpaginated: one bare GET, no page params. */ diff --git a/test/src/sections/autolinks/generators.ts b/test/sections/autolinks/generators.ts similarity index 84% rename from test/src/sections/autolinks/generators.ts rename to test/sections/autolinks/generators.ts index 48ca2d41..97c3b382 100644 --- a/test/src/sections/autolinks/generators.ts +++ b/test/sections/autolinks/generators.ts @@ -2,16 +2,16 @@ * The autolinks fuzz generator fragment. */ -import { autolinksSection } from "../../../../src/sections/autolinks/index.js"; -import { AutolinkConfig } from "../../../../src/sections/autolinks/schema.js"; +import { autolinksSection } from "../../../src/sections/autolinks/index.js"; +import { AutolinkConfig } from "../../../src/sections/autolinks/schema.js"; import { generatorFromSlice, type Json, type LiveWitness, type LiveWitnessKind, lensWitness, -} from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +} from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; // No pool prefix begins another: a suffixed collision ("TICKET-" and "TICKET--1") would be the // pair the section refuses before its first create. diff --git a/test/src/sections/autolinks/mock.ts b/test/sections/autolinks/mock.ts similarity index 81% rename from test/src/sections/autolinks/mock.ts rename to test/sections/autolinks/mock.ts index 066f52c7..3501122f 100644 --- a/test/src/sections/autolinks/mock.ts +++ b/test/sections/autolinks/mock.ts @@ -3,9 +3,9 @@ * test/e2e/mock/list-fragment.ts; only the server-owned facts live here. */ -import { autolinksSection } from "../../../../src/sections/autolinks/index.js"; -import { type ListMockSpec, mockFragmentFor } from "../../../e2e/mock/list-fragment.js"; -import type { SectionRestHandlers } from "../../../e2e/mock/support.js"; +import { autolinksSection } from "../../../src/sections/autolinks/index.js"; +import { type ListMockSpec, mockFragmentFor } from "../../e2e/mock/list-fragment.js"; +import type { SectionRestHandlers } from "../../e2e/mock/support.js"; export const AUTOLINKS_MOCK: ListMockSpec = { collection: (state) => state.autolinks, diff --git a/test/src/sections/autolinks/scenarios/autolinks-apply-converges.yml b/test/sections/autolinks/scenarios/autolinks-apply-converges.yml similarity index 100% rename from test/src/sections/autolinks/scenarios/autolinks-apply-converges.yml rename to test/sections/autolinks/scenarios/autolinks-apply-converges.yml diff --git a/test/src/sections/autolinks/scenarios/autolinks-check-drift.yml b/test/sections/autolinks/scenarios/autolinks-check-drift.yml similarity index 100% rename from test/src/sections/autolinks/scenarios/autolinks-check-drift.yml rename to test/sections/autolinks/scenarios/autolinks-check-drift.yml diff --git a/test/src/sections/autolinks/scenarios/autolinks-invalid-entries.yml b/test/sections/autolinks/scenarios/autolinks-invalid-entries.yml similarity index 100% rename from test/src/sections/autolinks/scenarios/autolinks-invalid-entries.yml rename to test/sections/autolinks/scenarios/autolinks-invalid-entries.yml diff --git a/test/src/sections/autolinks/scenarios/autolinks-overlapping-prefixes.yml b/test/sections/autolinks/scenarios/autolinks-overlapping-prefixes.yml similarity index 100% rename from test/src/sections/autolinks/scenarios/autolinks-overlapping-prefixes.yml rename to test/sections/autolinks/scenarios/autolinks-overlapping-prefixes.yml diff --git a/test/src/sections/autolinks/scenarios/autolinks-snapshot-roundtrip.yml b/test/sections/autolinks/scenarios/autolinks-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/autolinks/scenarios/autolinks-snapshot-roundtrip.yml rename to test/sections/autolinks/scenarios/autolinks-snapshot-roundtrip.yml diff --git a/test/src/sections/autolinks/scenarios/autolinks-undeclared-delete-frees-prefix.yml b/test/sections/autolinks/scenarios/autolinks-undeclared-delete-frees-prefix.yml similarity index 100% rename from test/src/sections/autolinks/scenarios/autolinks-undeclared-delete-frees-prefix.yml rename to test/sections/autolinks/scenarios/autolinks-undeclared-delete-frees-prefix.yml diff --git a/test/src/sections/autolinks/scenarios/autolinks-undeclared-delete.yml b/test/sections/autolinks/scenarios/autolinks-undeclared-delete.yml similarity index 100% rename from test/src/sections/autolinks/scenarios/autolinks-undeclared-delete.yml rename to test/sections/autolinks/scenarios/autolinks-undeclared-delete.yml diff --git a/test/src/sections/autolinks/scenarios/autolinks-undeclared-keep-note.yml b/test/sections/autolinks/scenarios/autolinks-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/autolinks/scenarios/autolinks-undeclared-keep-note.yml rename to test/sections/autolinks/scenarios/autolinks-undeclared-keep-note.yml diff --git a/test/src/sections/branches/branches.test.ts b/test/sections/branches/branches.test.ts similarity index 97% rename from test/src/sections/branches/branches.test.ts rename to test/sections/branches/branches.test.ts index ca213a18..7cf6928b 100644 --- a/test/src/sections/branches/branches.test.ts +++ b/test/sections/branches/branches.test.ts @@ -1,46 +1,43 @@ import { describe, expect, test } from "bun:test"; import type { Result } from "neverthrow"; -import { executePlan } from "../../../../src/engine/execute.js"; -import { SectionSelection } from "../../../../src/engine/section-selection.js"; -import { snapshotRepository } from "../../../../src/engine/snapshot.js"; -import type { GitHubClient } from "../../../../src/github/api.js"; -import { MISSING_BRANCH } from "../../../../src/sections/branches/endpoints.js"; -import type { - ExplicitKeys, - RestCarriedKey, -} from "../../../../src/sections/branches/graphql-rules.js"; +import { executePlan } from "../../../src/engine/execute.js"; +import { SectionSelection } from "../../../src/engine/section-selection.js"; +import { snapshotRepository } from "../../../src/engine/snapshot.js"; +import type { GitHubClient } from "../../../src/github/api.js"; +import { MISSING_BRANCH } from "../../../src/sections/branches/endpoints.js"; +import type { ExplicitKeys, RestCarriedKey } from "../../../src/sections/branches/graphql-rules.js"; import { branchesSection, type ClassifiedEntry, flattenProtection, protectionSnapshot, -} from "../../../../src/sections/branches/index.js"; -import { NULLABLE_CONTROLS } from "../../../../src/sections/branches/keys.js"; -import type { BranchProtectionConfig } from "../../../../src/sections/branches/schema.js"; +} from "../../../src/sections/branches/index.js"; +import { NULLABLE_CONTROLS } from "../../../src/sections/branches/keys.js"; +import type { BranchProtectionConfig } from "../../../src/sections/branches/schema.js"; import { endpointMethod, endpointPath, matchesTemplate, pathSegments, -} from "../../../../src/sections/contract/endpoints.js"; -import type { SectionFailure } from "../../../../src/sections/contract/errors.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; +} from "../../../src/sections/contract/endpoints.js"; +import type { SectionFailure } from "../../../src/sections/contract/errors.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; import { type PlannedOp, planContext, snapshotContext, -} from "../../../../src/sections/contract/plan.js"; -import { allEndpoints, allGraphqlOps } from "../../../../src/sections/registry.js"; -import type { MustBeNever } from "../../../../src/types.js"; -import { buildState, completeRule, type LiveState, ruleWireNode } from "../../../e2e/mock/state.js"; -import type { Json } from "../../../e2e/mock/support.js"; -import { captureIo } from "../../../io/capture.js"; -import { MockApi } from "../../../mock-api.js"; -import { registryFake } from "../../../sections/fragment-fake.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { failureOf, REPO, unwrap } from "../../../sections/section-run.js"; -import { proveSnapshotRoundTrip } from "../../../sections/snapshot-roundtrip.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +} from "../../../src/sections/contract/plan.js"; +import { allEndpoints, allGraphqlOps } from "../../../src/sections/registry.js"; +import type { MustBeNever } from "../../../src/types.js"; +import { buildState, completeRule, type LiveState, ruleWireNode } from "../../e2e/mock/state.js"; +import type { Json } from "../../e2e/mock/support.js"; +import { captureIo } from "../../io/capture.js"; +import { MockApi } from "../../mock-api.js"; +import { registryFake } from "../fragment-fake.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { failureOf, REPO, unwrap } from "../section-run.js"; +import { proveSnapshotRoundTrip } from "../snapshot-roundtrip.js"; +import { validatedInput } from "../validated-input.js"; import { branchesMockGraphqlHandlers, branchesMockHandlers, wildcardMatches } from "./mock.js"; /** The bare-list form of the section's value; the tests never hand plan() the `{_layering, entries}` wrapper. */ diff --git a/test/src/sections/branches/generators.ts b/test/sections/branches/generators.ts similarity index 96% rename from test/src/sections/branches/generators.ts rename to test/sections/branches/generators.ts index 9bbb05ca..880f1135 100644 --- a/test/src/sections/branches/generators.ts +++ b/test/sections/branches/generators.ts @@ -2,13 +2,13 @@ * The branches fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import type { Json } from "../../../e2e/gen-support.js"; +import type { Json } from "../../e2e/gen-support.js"; import { BYPASS_ACTOR_TEAMS, BYPASS_ACTOR_USERS, PROTECTION_RULE_APPS, -} from "../../../e2e/mock/state.js"; -import type { Rng } from "../../../e2e/prng.js"; +} from "../../e2e/mock/state.js"; +import type { Rng } from "../../e2e/prng.js"; const PROTECTION_CORE_KEYS = [ "required_status_checks", diff --git a/test/src/sections/branches/mock.ts b/test/sections/branches/mock.ts similarity index 98% rename from test/src/sections/branches/mock.ts rename to test/sections/branches/mock.ts index 48df522a..476108e4 100644 --- a/test/src/sections/branches/mock.ts +++ b/test/sections/branches/mock.ts @@ -3,10 +3,10 @@ */ import { createHash } from "node:crypto"; -import { MISSING_BRANCH } from "../../../../src/sections/branches/endpoints.js"; -import { classicViewOfRule, RuleNode } from "../../../../src/sections/branches/graphql-rules.js"; -import { BOOLEAN_CONTROL_SET, NULLABLE_CONTROLS } from "../../../../src/sections/branches/keys.js"; -import { decodeNodeId, mintNodeId } from "../../../e2e/mock/node-id.js"; +import { MISSING_BRANCH } from "../../../src/sections/branches/endpoints.js"; +import { classicViewOfRule, RuleNode } from "../../../src/sections/branches/graphql-rules.js"; +import { BOOLEAN_CONTROL_SET, NULLABLE_CONTROLS } from "../../../src/sections/branches/keys.js"; +import { decodeNodeId, mintNodeId } from "../../e2e/mock/node-id.js"; import { allRuleNodes, applyRuleInput, @@ -19,7 +19,7 @@ import { protectionFromPut, ruleFromProtection, ruleWireNode, -} from "../../../e2e/mock/state.js"; +} from "../../e2e/mock/state.js"; import { asObject, type GraphqlHandlerResult, @@ -33,7 +33,7 @@ import { type SectionGraphqlHandlers, type SectionRestHandlers, slicePage, -} from "../../../e2e/mock/support.js"; +} from "../../e2e/mock/support.js"; /** * GitHub's fnmatch (Ruby's, FNM_PATHNAME) for classic rule patterns: `*` and `?` stop at a slash, diff --git a/test/src/sections/branches/scenarios/branches-administration-denied-check-drift.yml b/test/sections/branches/scenarios/branches-administration-denied-check-drift.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-administration-denied-check-drift.yml rename to test/sections/branches/scenarios/branches-administration-denied-check-drift.yml diff --git a/test/src/sections/branches/scenarios/branches-apply-converges.yml b/test/sections/branches/scenarios/branches-apply-converges.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-apply-converges.yml rename to test/sections/branches/scenarios/branches-apply-converges.yml diff --git a/test/src/sections/branches/scenarios/branches-check-drift.yml b/test/sections/branches/scenarios/branches-check-drift.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-check-drift.yml rename to test/sections/branches/scenarios/branches-check-drift.yml diff --git a/test/src/sections/branches/scenarios/branches-empty-dismissal-restrictions-converges.yml b/test/sections/branches/scenarios/branches-empty-dismissal-restrictions-converges.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-empty-dismissal-restrictions-converges.yml rename to test/sections/branches/scenarios/branches-empty-dismissal-restrictions-converges.yml diff --git a/test/src/sections/branches/scenarios/branches-empty-restrictions-declared-apply-converges.yml b/test/sections/branches/scenarios/branches-empty-restrictions-declared-apply-converges.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-empty-restrictions-declared-apply-converges.yml rename to test/sections/branches/scenarios/branches-empty-restrictions-declared-apply-converges.yml diff --git a/test/src/sections/branches/scenarios/branches-empty-restrictions-omitted-check-drift.yml b/test/sections/branches/scenarios/branches-empty-restrictions-omitted-check-drift.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-empty-restrictions-omitted-check-drift.yml rename to test/sections/branches/scenarios/branches-empty-restrictions-omitted-check-drift.yml diff --git a/test/src/sections/branches/scenarios/branches-every-parse-error-one-run.yml b/test/sections/branches/scenarios/branches-every-parse-error-one-run.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-every-parse-error-one-run.yml rename to test/sections/branches/scenarios/branches-every-parse-error-one-run.yml diff --git a/test/src/sections/branches/scenarios/branches-existing-branch-no-contents-apply-converges.yml b/test/sections/branches/scenarios/branches-existing-branch-no-contents-apply-converges.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-existing-branch-no-contents-apply-converges.yml rename to test/sections/branches/scenarios/branches-existing-branch-no-contents-apply-converges.yml diff --git a/test/src/sections/branches/scenarios/branches-force-push-bypassers-apply-converges.yml b/test/sections/branches/scenarios/branches-force-push-bypassers-apply-converges.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-force-push-bypassers-apply-converges.yml rename to test/sections/branches/scenarios/branches-force-push-bypassers-apply-converges.yml diff --git a/test/src/sections/branches/scenarios/branches-force-push-bypassers-check-drift.yml b/test/sections/branches/scenarios/branches-force-push-bypassers-check-drift.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-force-push-bypassers-check-drift.yml rename to test/sections/branches/scenarios/branches-force-push-bypassers-check-drift.yml diff --git a/test/src/sections/branches/scenarios/branches-get-actor-list-copied-rejected.yml b/test/sections/branches/scenarios/branches-get-actor-list-copied-rejected.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-get-actor-list-copied-rejected.yml rename to test/sections/branches/scenarios/branches-get-actor-list-copied-rejected.yml diff --git a/test/src/sections/branches/scenarios/branches-get-response-copied-rejected.yml b/test/sections/branches/scenarios/branches-get-response-copied-rejected.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-get-response-copied-rejected.yml rename to test/sections/branches/scenarios/branches-get-response-copied-rejected.yml diff --git a/test/src/sections/branches/scenarios/branches-missing-branch-advisory-apply-fails.yml b/test/sections/branches/scenarios/branches-missing-branch-advisory-apply-fails.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-missing-branch-advisory-apply-fails.yml rename to test/sections/branches/scenarios/branches-missing-branch-advisory-apply-fails.yml diff --git a/test/src/sections/branches/scenarios/branches-missing-branch-advisory.yml b/test/sections/branches/scenarios/branches-missing-branch-advisory.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-missing-branch-advisory.yml rename to test/sections/branches/scenarios/branches-missing-branch-advisory.yml diff --git a/test/src/sections/branches/scenarios/branches-missing-branch-no-contents-apply-fails.yml b/test/sections/branches/scenarios/branches-missing-branch-no-contents-apply-fails.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-missing-branch-no-contents-apply-fails.yml rename to test/sections/branches/scenarios/branches-missing-branch-no-contents-apply-fails.yml diff --git a/test/src/sections/branches/scenarios/branches-missing-branch-no-contents-apply-warn-fails.yml b/test/sections/branches/scenarios/branches-missing-branch-no-contents-apply-warn-fails.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-missing-branch-no-contents-apply-warn-fails.yml rename to test/sections/branches/scenarios/branches-missing-branch-no-contents-apply-warn-fails.yml diff --git a/test/src/sections/branches/scenarios/branches-missing-branch-no-contents.yml b/test/sections/branches/scenarios/branches-missing-branch-no-contents.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-missing-branch-no-contents.yml rename to test/sections/branches/scenarios/branches-missing-branch-no-contents.yml diff --git a/test/src/sections/branches/scenarios/branches-mixed-case-restrictions-apply-converges.yml b/test/sections/branches/scenarios/branches-mixed-case-restrictions-apply-converges.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-mixed-case-restrictions-apply-converges.yml rename to test/sections/branches/scenarios/branches-mixed-case-restrictions-apply-converges.yml diff --git a/test/src/sections/branches/scenarios/branches-mixed-case-restrictions-check-clean.yml b/test/sections/branches/scenarios/branches-mixed-case-restrictions-check-clean.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-mixed-case-restrictions-check-clean.yml rename to test/sections/branches/scenarios/branches-mixed-case-restrictions-check-clean.yml diff --git a/test/src/sections/branches/scenarios/branches-null-removal-converges.yml b/test/sections/branches/scenarios/branches-null-removal-converges.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-null-removal-converges.yml rename to test/sections/branches/scenarios/branches-null-removal-converges.yml diff --git a/test/src/sections/branches/scenarios/branches-protection-unknown-key-noted.yml b/test/sections/branches/scenarios/branches-protection-unknown-key-noted.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-protection-unknown-key-noted.yml rename to test/sections/branches/scenarios/branches-protection-unknown-key-noted.yml diff --git a/test/src/sections/branches/scenarios/branches-required-deployments-apply-converges.yml b/test/sections/branches/scenarios/branches-required-deployments-apply-converges.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-required-deployments-apply-converges.yml rename to test/sections/branches/scenarios/branches-required-deployments-apply-converges.yml diff --git a/test/src/sections/branches/scenarios/branches-required-deployments-dropped-env-error.yml b/test/sections/branches/scenarios/branches-required-deployments-dropped-env-error.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-required-deployments-dropped-env-error.yml rename to test/sections/branches/scenarios/branches-required-deployments-dropped-env-error.yml diff --git a/test/src/sections/branches/scenarios/branches-required-signatures-apply-converges.yml b/test/sections/branches/scenarios/branches-required-signatures-apply-converges.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-required-signatures-apply-converges.yml rename to test/sections/branches/scenarios/branches-required-signatures-apply-converges.yml diff --git a/test/src/sections/branches/scenarios/branches-required-signatures-check-drift.yml b/test/sections/branches/scenarios/branches-required-signatures-check-drift.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-required-signatures-check-drift.yml rename to test/sections/branches/scenarios/branches-required-signatures-check-drift.yml diff --git a/test/src/sections/branches/scenarios/branches-rest-only-no-graphql.yml b/test/sections/branches/scenarios/branches-rest-only-no-graphql.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-rest-only-no-graphql.yml rename to test/sections/branches/scenarios/branches-rest-only-no-graphql.yml diff --git a/test/src/sections/branches/scenarios/branches-restrictions-actor-change-check-drift.yml b/test/sections/branches/scenarios/branches-restrictions-actor-change-check-drift.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-restrictions-actor-change-check-drift.yml rename to test/sections/branches/scenarios/branches-restrictions-actor-change-check-drift.yml diff --git a/test/src/sections/branches/scenarios/branches-restrictions-missing-lists-rejected.yml b/test/sections/branches/scenarios/branches-restrictions-missing-lists-rejected.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-restrictions-missing-lists-rejected.yml rename to test/sections/branches/scenarios/branches-restrictions-missing-lists-rejected.yml diff --git a/test/src/sections/branches/scenarios/branches-snapshot-roundtrip.yml b/test/sections/branches/scenarios/branches-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-snapshot-roundtrip.yml rename to test/sections/branches/scenarios/branches-snapshot-roundtrip.yml diff --git a/test/src/sections/branches/scenarios/branches-undeclared-glob-note-apply.yml b/test/sections/branches/scenarios/branches-undeclared-glob-note-apply.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-undeclared-glob-note-apply.yml rename to test/sections/branches/scenarios/branches-undeclared-glob-note-apply.yml diff --git a/test/src/sections/branches/scenarios/branches-undeclared-glob-note-check.yml b/test/sections/branches/scenarios/branches-undeclared-glob-note-check.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-undeclared-glob-note-check.yml rename to test/sections/branches/scenarios/branches-undeclared-glob-note-check.yml diff --git a/test/src/sections/branches/scenarios/branches-wildcard-lifecycle.yml b/test/sections/branches/scenarios/branches-wildcard-lifecycle.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-wildcard-lifecycle.yml rename to test/sections/branches/scenarios/branches-wildcard-lifecycle.yml diff --git a/test/src/sections/branches/scenarios/branches-wildcard-untranslatable-key-rejected.yml b/test/sections/branches/scenarios/branches-wildcard-untranslatable-key-rejected.yml similarity index 100% rename from test/src/sections/branches/scenarios/branches-wildcard-untranslatable-key-rejected.yml rename to test/sections/branches/scenarios/branches-wildcard-untranslatable-key-rejected.yml diff --git a/test/src/sections/branches/schema.test.ts b/test/sections/branches/schema.test.ts similarity index 99% rename from test/src/sections/branches/schema.test.ts rename to test/sections/branches/schema.test.ts index 960e9f34..73c0bb93 100644 --- a/test/src/sections/branches/schema.test.ts +++ b/test/sections/branches/schema.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "bun:test"; -import { branchesSection, protectionSnapshot } from "../../../../src/sections/branches/index.js"; +import { branchesSection, protectionSnapshot } from "../../../src/sections/branches/index.js"; /** Every issue as "path: message", so a case pins the whole verdict and not one line of it. */ function issues(entries: unknown[]): string[] { diff --git a/test/src/sections/check_suite_preferences/check_suite_preferences.test.ts b/test/sections/check_suite_preferences/check_suite_preferences.test.ts similarity index 87% rename from test/src/sections/check_suite_preferences/check_suite_preferences.test.ts rename to test/sections/check_suite_preferences/check_suite_preferences.test.ts index 365e3526..c63d6482 100644 --- a/test/src/sections/check_suite_preferences/check_suite_preferences.test.ts +++ b/test/sections/check_suite_preferences/check_suite_preferences.test.ts @@ -1,12 +1,12 @@ import { describe, expect, test } from "bun:test"; -import { executePlan } from "../../../../src/engine/execute.js"; -import { checkSuitePreferencesSection } from "../../../../src/sections/check_suite_preferences/index.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { planContext, type SectionPlan } from "../../../../src/sections/contract/plan.js"; -import { MockApi } from "../../../mock-api.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import { executePlan } from "../../../src/engine/execute.js"; +import { checkSuitePreferencesSection } from "../../../src/sections/check_suite_preferences/index.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { planContext, type SectionPlan } from "../../../src/sections/contract/plan.js"; +import { MockApi } from "../../mock-api.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; describe("check_suite_preferences", () => { const path = "/repos/o/r/check-suites/preferences"; diff --git a/test/src/sections/check_suite_preferences/generators.ts b/test/sections/check_suite_preferences/generators.ts similarity index 84% rename from test/src/sections/check_suite_preferences/generators.ts rename to test/sections/check_suite_preferences/generators.ts index 5809f388..522ad56e 100644 --- a/test/src/sections/check_suite_preferences/generators.ts +++ b/test/sections/check_suite_preferences/generators.ts @@ -2,8 +2,8 @@ * The check_suite_preferences fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import type { Json } from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +import type { Json } from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; // A prefix of this list, so the ids are positive and distinct by construction: schema.ts refuses 0, fractions, and a repeat. const AUTO_TRIGGER_APP_IDS = [15368, 29310, 62410] as const; diff --git a/test/src/sections/check_suite_preferences/mock.ts b/test/sections/check_suite_preferences/mock.ts similarity index 80% rename from test/src/sections/check_suite_preferences/mock.ts rename to test/sections/check_suite_preferences/mock.ts index 54b638a6..02354a93 100644 --- a/test/src/sections/check_suite_preferences/mock.ts +++ b/test/sections/check_suite_preferences/mock.ts @@ -2,8 +2,8 @@ * The check_suite_preferences e2e mock fragment (aggregated in test/e2e/mock/sections.ts). */ -import { restRepoSurface } from "../../../e2e/mock/state.js"; -import { asObject, ok, type SectionRestHandlers } from "../../../e2e/mock/support.js"; +import { restRepoSurface } from "../../e2e/mock/state.js"; +import { asObject, ok, type SectionRestHandlers } from "../../e2e/mock/support.js"; export const checkSuitePreferencesMockHandlers: SectionRestHandlers<"check_suite_preferences"> = { "check_suite_preferences.update": ({ state, body }) => { diff --git a/test/src/sections/check_suite_preferences/scenarios/check-suite-preferences-apply-converges.yml b/test/sections/check_suite_preferences/scenarios/check-suite-preferences-apply-converges.yml similarity index 100% rename from test/src/sections/check_suite_preferences/scenarios/check-suite-preferences-apply-converges.yml rename to test/sections/check_suite_preferences/scenarios/check-suite-preferences-apply-converges.yml diff --git a/test/src/sections/check_suite_preferences/scenarios/check-suite-preferences-check-note.yml b/test/sections/check_suite_preferences/scenarios/check-suite-preferences-check-note.yml similarity index 100% rename from test/src/sections/check_suite_preferences/scenarios/check-suite-preferences-check-note.yml rename to test/sections/check_suite_preferences/scenarios/check-suite-preferences-check-note.yml diff --git a/test/src/sections/check_suite_preferences/scenarios/check-suite-preferences-invalid-app-id-rejected.yml b/test/sections/check_suite_preferences/scenarios/check-suite-preferences-invalid-app-id-rejected.yml similarity index 100% rename from test/src/sections/check_suite_preferences/scenarios/check-suite-preferences-invalid-app-id-rejected.yml rename to test/sections/check_suite_preferences/scenarios/check-suite-preferences-invalid-app-id-rejected.yml diff --git a/test/src/sections/check_suite_preferences/scenarios/check-suite-preferences-write-denied.yml b/test/sections/check_suite_preferences/scenarios/check-suite-preferences-write-denied.yml similarity index 100% rename from test/src/sections/check_suite_preferences/scenarios/check-suite-preferences-write-denied.yml rename to test/sections/check_suite_preferences/scenarios/check-suite-preferences-write-denied.yml diff --git a/test/sections/check-suite-preferences-schema.test.ts b/test/sections/check_suite_preferences/schema.test.ts similarity index 97% rename from test/sections/check-suite-preferences-schema.test.ts rename to test/sections/check_suite_preferences/schema.test.ts index fc61e91b..4df5126d 100644 --- a/test/sections/check-suite-preferences-schema.test.ts +++ b/test/sections/check_suite_preferences/schema.test.ts @@ -7,7 +7,7 @@ */ import { describe, expect, test } from "bun:test"; -import { validateSectionShapes } from "../../src/engine/validate.js"; +import { validateSectionShapes } from "../../../src/engine/validate.js"; /** The parsed section is what the PATCH sends, so an accepted document is judged by it, not by a bare verdict. */ function verdict(entries: readonly unknown[]): { parsed: unknown } | { issues: readonly string[] } { diff --git a/test/src/sections/code_quality_setup/generators.ts b/test/sections/code_quality_setup/generators.ts similarity index 76% rename from test/src/sections/code_quality_setup/generators.ts rename to test/sections/code_quality_setup/generators.ts index 7908a441..1dc055df 100644 --- a/test/src/sections/code_quality_setup/generators.ts +++ b/test/sections/code_quality_setup/generators.ts @@ -2,9 +2,9 @@ * The code_quality_setup fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import { CODE_QUALITY_LANGUAGES } from "../../../../src/sections/code_quality_setup/schema.js"; -import type { Json } from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +import { CODE_QUALITY_LANGUAGES } from "../../../src/sections/code_quality_setup/schema.js"; +import type { Json } from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; export function genCodeQuality(rng: Rng): Json { const cfg: Json = { state: rng.pick(["configured", "not-configured"]) }; diff --git a/test/src/sections/code_quality_setup/mock.ts b/test/sections/code_quality_setup/mock.ts similarity index 92% rename from test/src/sections/code_quality_setup/mock.ts rename to test/sections/code_quality_setup/mock.ts index 1e069a50..2b4f485a 100644 --- a/test/src/sections/code_quality_setup/mock.ts +++ b/test/sections/code_quality_setup/mock.ts @@ -3,7 +3,7 @@ * and registered in test/e2e/mock/sections.ts. */ -import { type SectionRestHandlers, setupRestHandlers } from "../../../e2e/mock/support.js"; +import { type SectionRestHandlers, setupRestHandlers } from "../../e2e/mock/support.js"; export const codeQualitySetupMockHandlers: SectionRestHandlers<"code_quality_setup"> = setupRestHandlers("code_quality_setup"); diff --git a/test/src/sections/code_quality_setup/scenarios/code-quality-apply-202.yml b/test/sections/code_quality_setup/scenarios/code-quality-apply-202.yml similarity index 100% rename from test/src/sections/code_quality_setup/scenarios/code-quality-apply-202.yml rename to test/sections/code_quality_setup/scenarios/code-quality-apply-202.yml diff --git a/test/src/sections/code_quality_setup/scenarios/code-quality-run-in-progress-409.yml b/test/sections/code_quality_setup/scenarios/code-quality-run-in-progress-409.yml similarity index 100% rename from test/src/sections/code_quality_setup/scenarios/code-quality-run-in-progress-409.yml rename to test/sections/code_quality_setup/scenarios/code-quality-run-in-progress-409.yml diff --git a/test/src/sections/code_quality_setup/scenarios/code-quality-setup-apply-converges.yml b/test/sections/code_quality_setup/scenarios/code-quality-setup-apply-converges.yml similarity index 100% rename from test/src/sections/code_quality_setup/scenarios/code-quality-setup-apply-converges.yml rename to test/sections/code_quality_setup/scenarios/code-quality-setup-apply-converges.yml diff --git a/test/src/sections/code_quality_setup/scenarios/code-quality-setup-check-drift.yml b/test/sections/code_quality_setup/scenarios/code-quality-setup-check-drift.yml similarity index 100% rename from test/src/sections/code_quality_setup/scenarios/code-quality-setup-check-drift.yml rename to test/sections/code_quality_setup/scenarios/code-quality-setup-check-drift.yml diff --git a/test/src/sections/code_quality_setup/scenarios/code-quality-setup-runner-label-without-labeled-rejected.yml b/test/sections/code_quality_setup/scenarios/code-quality-setup-runner-label-without-labeled-rejected.yml similarity index 100% rename from test/src/sections/code_quality_setup/scenarios/code-quality-setup-runner-label-without-labeled-rejected.yml rename to test/sections/code_quality_setup/scenarios/code-quality-setup-runner-label-without-labeled-rejected.yml diff --git a/test/src/sections/code_quality_setup/scenarios/code-quality-setup-snapshot-drops-undeclarable-language.yml b/test/sections/code_quality_setup/scenarios/code-quality-setup-snapshot-drops-undeclarable-language.yml similarity index 100% rename from test/src/sections/code_quality_setup/scenarios/code-quality-setup-snapshot-drops-undeclarable-language.yml rename to test/sections/code_quality_setup/scenarios/code-quality-setup-snapshot-drops-undeclarable-language.yml diff --git a/test/src/sections/code_quality_setup/scenarios/code-quality-setup-snapshot-roundtrip.yml b/test/sections/code_quality_setup/scenarios/code-quality-setup-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/code_quality_setup/scenarios/code-quality-setup-snapshot-roundtrip.yml rename to test/sections/code_quality_setup/scenarios/code-quality-setup-snapshot-roundtrip.yml diff --git a/test/src/sections/code_quality_setup/scenarios/code-quality-setup-unknown-key-noted.yml b/test/sections/code_quality_setup/scenarios/code-quality-setup-unknown-key-noted.yml similarity index 100% rename from test/src/sections/code_quality_setup/scenarios/code-quality-setup-unknown-key-noted.yml rename to test/sections/code_quality_setup/scenarios/code-quality-setup-unknown-key-noted.yml diff --git a/test/src/sections/code_scanning_default_setup/generators.ts b/test/sections/code_scanning_default_setup/generators.ts similarity index 80% rename from test/src/sections/code_scanning_default_setup/generators.ts rename to test/sections/code_scanning_default_setup/generators.ts index 7ad4cb28..1b9896eb 100644 --- a/test/src/sections/code_scanning_default_setup/generators.ts +++ b/test/sections/code_scanning_default_setup/generators.ts @@ -2,9 +2,9 @@ * The code_scanning_default_setup fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import { CODE_SCANNING_LANGUAGES } from "../../../../src/sections/code_scanning_default_setup/schema.js"; -import type { Json } from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +import { CODE_SCANNING_LANGUAGES } from "../../../src/sections/code_scanning_default_setup/schema.js"; +import type { Json } from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; export function genCodeScanning(rng: Rng): Json { const cfg: Json = { state: rng.pick(["configured", "not-configured"]) }; diff --git a/test/src/sections/code_scanning_default_setup/mock.ts b/test/sections/code_scanning_default_setup/mock.ts similarity index 93% rename from test/src/sections/code_scanning_default_setup/mock.ts rename to test/sections/code_scanning_default_setup/mock.ts index e744ebe1..5fd3c256 100644 --- a/test/src/sections/code_scanning_default_setup/mock.ts +++ b/test/sections/code_scanning_default_setup/mock.ts @@ -3,7 +3,7 @@ * test/e2e/mock/support.ts and registered in test/e2e/mock/sections.ts. */ -import { type SectionRestHandlers, setupRestHandlers } from "../../../e2e/mock/support.js"; +import { type SectionRestHandlers, setupRestHandlers } from "../../e2e/mock/support.js"; export const codeScanningDefaultSetupMockHandlers: SectionRestHandlers<"code_scanning_default_setup"> = setupRestHandlers("code_scanning_default_setup"); diff --git a/test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-apply-converges.yml b/test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-apply-converges.yml similarity index 100% rename from test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-apply-converges.yml rename to test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-apply-converges.yml diff --git a/test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-check-drift.yml b/test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-check-drift.yml similarity index 100% rename from test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-check-drift.yml rename to test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-check-drift.yml diff --git a/test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-get-only-key-rejected.yml b/test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-get-only-key-rejected.yml similarity index 100% rename from test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-get-only-key-rejected.yml rename to test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-get-only-key-rejected.yml diff --git a/test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-snapshot-folds-languages.yml b/test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-snapshot-folds-languages.yml similarity index 100% rename from test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-snapshot-folds-languages.yml rename to test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-snapshot-folds-languages.yml diff --git a/test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-snapshot-roundtrip.yml b/test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-snapshot-roundtrip.yml rename to test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-snapshot-roundtrip.yml diff --git a/test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-unknown-key-noted.yml b/test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-unknown-key-noted.yml similarity index 100% rename from test/src/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-unknown-key-noted.yml rename to test/sections/code_scanning_default_setup/scenarios/code-scanning-default-setup-unknown-key-noted.yml diff --git a/test/src/sections/code_scanning_default_setup/scenarios/code-scanning-run-in-progress.yml b/test/sections/code_scanning_default_setup/scenarios/code-scanning-run-in-progress.yml similarity index 100% rename from test/src/sections/code_scanning_default_setup/scenarios/code-scanning-run-in-progress.yml rename to test/sections/code_scanning_default_setup/scenarios/code-scanning-run-in-progress.yml diff --git a/test/src/sections/codespaces_secrets/mock.ts b/test/sections/codespaces_secrets/mock.ts similarity index 90% rename from test/src/sections/codespaces_secrets/mock.ts rename to test/sections/codespaces_secrets/mock.ts index c217f59b..cd6d2d53 100644 --- a/test/src/sections/codespaces_secrets/mock.ts +++ b/test/sections/codespaces_secrets/mock.ts @@ -3,7 +3,7 @@ * test/e2e/mock/support.ts. */ -import { repoSecretsRestHandlers, type SectionRestHandlers } from "../../../e2e/mock/support.js"; +import { repoSecretsRestHandlers, type SectionRestHandlers } from "../../e2e/mock/support.js"; export const codespacesSecretsMockHandlers: SectionRestHandlers<"codespaces_secrets"> = repoSecretsRestHandlers("codespaces_secrets"); diff --git a/test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-apply-converges.yml b/test/sections/codespaces_secrets/scenarios/codespaces-secrets-apply-converges.yml similarity index 100% rename from test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-apply-converges.yml rename to test/sections/codespaces_secrets/scenarios/codespaces-secrets-apply-converges.yml diff --git a/test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-check-drift.yml b/test/sections/codespaces_secrets/scenarios/codespaces-secrets-check-drift.yml similarity index 100% rename from test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-check-drift.yml rename to test/sections/codespaces_secrets/scenarios/codespaces-secrets-check-drift.yml diff --git a/test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-name-rejected.yml b/test/sections/codespaces_secrets/scenarios/codespaces-secrets-name-rejected.yml similarity index 100% rename from test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-name-rejected.yml rename to test/sections/codespaces_secrets/scenarios/codespaces-secrets-name-rejected.yml diff --git a/test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-read-only-denied.yml b/test/sections/codespaces_secrets/scenarios/codespaces-secrets-read-only-denied.yml similarity index 100% rename from test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-read-only-denied.yml rename to test/sections/codespaces_secrets/scenarios/codespaces-secrets-read-only-denied.yml diff --git a/test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-snapshot-roundtrip.yml b/test/sections/codespaces_secrets/scenarios/codespaces-secrets-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-snapshot-roundtrip.yml rename to test/sections/codespaces_secrets/scenarios/codespaces-secrets-snapshot-roundtrip.yml diff --git a/test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-undeclared-delete.yml b/test/sections/codespaces_secrets/scenarios/codespaces-secrets-undeclared-delete.yml similarity index 100% rename from test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-undeclared-delete.yml rename to test/sections/codespaces_secrets/scenarios/codespaces-secrets-undeclared-delete.yml diff --git a/test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-undeclared-keep-note.yml b/test/sections/codespaces_secrets/scenarios/codespaces-secrets-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/codespaces_secrets/scenarios/codespaces-secrets-undeclared-keep-note.yml rename to test/sections/codespaces_secrets/scenarios/codespaces-secrets-undeclared-keep-note.yml diff --git a/test/src/sections/collaborators/collaborators.test.ts b/test/sections/collaborators/collaborators.test.ts similarity index 95% rename from test/src/sections/collaborators/collaborators.test.ts rename to test/sections/collaborators/collaborators.test.ts index 081a0af5..ef89d44e 100644 --- a/test/src/sections/collaborators/collaborators.test.ts +++ b/test/sections/collaborators/collaborators.test.ts @@ -1,12 +1,12 @@ import { describe, expect, test } from "bun:test"; -import { collaboratorsSection } from "../../../../src/sections/collaborators/index.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { planContext, snapshotContext } from "../../../../src/sections/contract/plan.js"; -import { MockApi } from "../../../mock-api.js"; -import { fragmentFake } from "../../../sections/fragment-fake.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { deniedDetail, REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import { collaboratorsSection } from "../../../src/sections/collaborators/index.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { planContext, snapshotContext } from "../../../src/sections/contract/plan.js"; +import { MockApi } from "../../mock-api.js"; +import { fragmentFake } from "../fragment-fake.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { deniedDetail, REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; import { collaboratorsMockHandlers } from "./mock.js"; const LIST = "GET /repos/o/r/collaborators?affiliation=direct&per_page=100&page=1"; diff --git a/test/src/sections/collaborators/generators.ts b/test/sections/collaborators/generators.ts similarity index 87% rename from test/src/sections/collaborators/generators.ts rename to test/sections/collaborators/generators.ts index d5085e9c..200d2975 100644 --- a/test/src/sections/collaborators/generators.ts +++ b/test/sections/collaborators/generators.ts @@ -2,16 +2,16 @@ * The collaborators fuzz generator fragment and the pending-invitation live-state seeder. */ -import { CollaboratorConfig } from "../../../../src/sections/collaborators/schema.js"; -import { DEFAULT_ROLE, roleForPermission } from "../../../../src/sections/shared/roles.js"; +import { CollaboratorConfig } from "../../../src/sections/collaborators/schema.js"; +import { DEFAULT_ROLE, roleForPermission } from "../../../src/sections/shared/roles.js"; import { type EntriesForm, generatorFromSlice, type Json, maybeWrapUndeclared, uniqueBy, -} from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +} from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; const genCollaborator = generatorFromSlice(CollaboratorConfig, { fields: { diff --git a/test/src/sections/collaborators/mock.test.ts b/test/sections/collaborators/mock.test.ts similarity index 95% rename from test/src/sections/collaborators/mock.test.ts rename to test/sections/collaborators/mock.test.ts index 926200f3..8c40f3cc 100644 --- a/test/src/sections/collaborators/mock.test.ts +++ b/test/sections/collaborators/mock.test.ts @@ -6,9 +6,9 @@ */ import { describe, expect, test } from "bun:test"; -import { handlerTestContext } from "../../../e2e/mock/handler-test-ctx.js"; -import { buildStateForSlug, type MockState } from "../../../e2e/mock/state.js"; -import type { OwnerKind } from "../../../e2e/schema.js"; +import { handlerTestContext } from "../../e2e/mock/handler-test-ctx.js"; +import { buildStateForSlug, type MockState } from "../../e2e/mock/state.js"; +import type { OwnerKind } from "../../e2e/schema.js"; import { collaboratorsMockHandlers } from "./mock.js"; const PARAMS = { owner: "acme", repo: "widgets" }; diff --git a/test/src/sections/collaborators/mock.ts b/test/sections/collaborators/mock.ts similarity index 97% rename from test/src/sections/collaborators/mock.ts rename to test/sections/collaborators/mock.ts index bc26f563..6271c452 100644 --- a/test/src/sections/collaborators/mock.ts +++ b/test/sections/collaborators/mock.ts @@ -8,7 +8,7 @@ import { invitationFromPut, invitationPermissionFromPut, settableInvitationRole, -} from "../../../e2e/mock/state.js"; +} from "../../e2e/mock/state.js"; import { asObject, type Json, @@ -17,7 +17,7 @@ import { PERMISSION_NOT_GRANTABLE, type SectionRestHandlers, slicePage, -} from "../../../e2e/mock/support.js"; +} from "../../e2e/mock/support.js"; export const collaboratorsMockHandlers: SectionRestHandlers<"collaborators"> = { "collaborators.list": ({ state, query }) => ok(slicePage(state.collaborators, query)), diff --git a/test/src/sections/collaborators/scenarios/collaborators-apply-converges.yml b/test/sections/collaborators/scenarios/collaborators-apply-converges.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/collaborators-apply-converges.yml rename to test/sections/collaborators/scenarios/collaborators-apply-converges.yml diff --git a/test/src/sections/collaborators/scenarios/collaborators-check-drift.yml b/test/sections/collaborators/scenarios/collaborators-check-drift.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/collaborators-check-drift.yml rename to test/sections/collaborators/scenarios/collaborators-check-drift.yml diff --git a/test/src/sections/collaborators/scenarios/collaborators-owner-guard.yml b/test/sections/collaborators/scenarios/collaborators-owner-guard.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/collaborators-owner-guard.yml rename to test/sections/collaborators/scenarios/collaborators-owner-guard.yml diff --git a/test/src/sections/collaborators/scenarios/collaborators-permission-not-grantable-rejected.yml b/test/sections/collaborators/scenarios/collaborators-permission-not-grantable-rejected.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/collaborators-permission-not-grantable-rejected.yml rename to test/sections/collaborators/scenarios/collaborators-permission-not-grantable-rejected.yml diff --git a/test/src/sections/collaborators/scenarios/collaborators-snapshot-expired-invitation.yml b/test/sections/collaborators/scenarios/collaborators-snapshot-expired-invitation.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/collaborators-snapshot-expired-invitation.yml rename to test/sections/collaborators/scenarios/collaborators-snapshot-expired-invitation.yml diff --git a/test/src/sections/collaborators/scenarios/collaborators-snapshot-roundtrip.yml b/test/sections/collaborators/scenarios/collaborators-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/collaborators-snapshot-roundtrip.yml rename to test/sections/collaborators/scenarios/collaborators-snapshot-roundtrip.yml diff --git a/test/src/sections/collaborators/scenarios/collaborators-undeclared-delete.yml b/test/sections/collaborators/scenarios/collaborators-undeclared-delete.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/collaborators-undeclared-delete.yml rename to test/sections/collaborators/scenarios/collaborators-undeclared-delete.yml diff --git a/test/src/sections/collaborators/scenarios/collaborators-undeclared-keep-note.yml b/test/sections/collaborators/scenarios/collaborators-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/collaborators-undeclared-keep-note.yml rename to test/sections/collaborators/scenarios/collaborators-undeclared-keep-note.yml diff --git a/test/src/sections/collaborators/scenarios/collaborators-unknown-key-rejected.yml b/test/sections/collaborators/scenarios/collaborators-unknown-key-rejected.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/collaborators-unknown-key-rejected.yml rename to test/sections/collaborators/scenarios/collaborators-unknown-key-rejected.yml diff --git a/test/src/sections/collaborators/scenarios/invitations-check-drift.yml b/test/sections/collaborators/scenarios/invitations-check-drift.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/invitations-check-drift.yml rename to test/sections/collaborators/scenarios/invitations-check-drift.yml diff --git a/test/src/sections/collaborators/scenarios/invitations-email-check-clean.yml b/test/sections/collaborators/scenarios/invitations-email-check-clean.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/invitations-email-check-clean.yml rename to test/sections/collaborators/scenarios/invitations-email-check-clean.yml diff --git a/test/src/sections/collaborators/scenarios/invitations-expired-custom-role.yml b/test/sections/collaborators/scenarios/invitations-expired-custom-role.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/invitations-expired-custom-role.yml rename to test/sections/collaborators/scenarios/invitations-expired-custom-role.yml diff --git a/test/src/sections/collaborators/scenarios/invitations-expired-reinvite.yml b/test/sections/collaborators/scenarios/invitations-expired-reinvite.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/invitations-expired-reinvite.yml rename to test/sections/collaborators/scenarios/invitations-expired-reinvite.yml diff --git a/test/src/sections/collaborators/scenarios/invitations-reconcile.yml b/test/sections/collaborators/scenarios/invitations-reconcile.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/invitations-reconcile.yml rename to test/sections/collaborators/scenarios/invitations-reconcile.yml diff --git a/test/src/sections/collaborators/scenarios/invitations-undeclared-keep-note.yml b/test/sections/collaborators/scenarios/invitations-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/collaborators/scenarios/invitations-undeclared-keep-note.yml rename to test/sections/collaborators/scenarios/invitations-undeclared-keep-note.yml diff --git a/test/src/sections/custom_properties/custom_properties.test.ts b/test/sections/custom_properties/custom_properties.test.ts similarity index 92% rename from test/src/sections/custom_properties/custom_properties.test.ts rename to test/sections/custom_properties/custom_properties.test.ts index 6043489e..88d1d866 100644 --- a/test/src/sections/custom_properties/custom_properties.test.ts +++ b/test/sections/custom_properties/custom_properties.test.ts @@ -1,17 +1,17 @@ import { describe, expect, test } from "bun:test"; -import type { GitHubClient } from "../../../../src/github/api.js"; -import type { SectionInput, SectionModule } from "../../../../src/sections/contract/module.js"; -import { planContext, type SectionPlan } from "../../../../src/sections/contract/plan.js"; +import type { GitHubClient } from "../../../src/github/api.js"; +import type { SectionInput, SectionModule } from "../../../src/sections/contract/module.js"; +import { planContext, type SectionPlan } from "../../../src/sections/contract/plan.js"; import { customPropertiesSection, normalizeValue, -} from "../../../../src/sections/custom_properties/index.js"; -import { sectionModule } from "../../../../src/sections/registry.js"; -import { MockApi } from "../../../mock-api.js"; -import { fragmentFake } from "../../../sections/fragment-fake.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +} from "../../../src/sections/custom_properties/index.js"; +import { sectionModule } from "../../../src/sections/registry.js"; +import { MockApi } from "../../mock-api.js"; +import { fragmentFake } from "../fragment-fake.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; import { customPropertiesMockHandlers } from "./mock.js"; /** The registered module: the owner gate the registry composes is part of the behavior under test. */ diff --git a/test/src/sections/custom_properties/generators.ts b/test/sections/custom_properties/generators.ts similarity index 91% rename from test/src/sections/custom_properties/generators.ts rename to test/sections/custom_properties/generators.ts index c395e852..b6f33544 100644 --- a/test/src/sections/custom_properties/generators.ts +++ b/test/sections/custom_properties/generators.ts @@ -2,9 +2,9 @@ * The custom_properties fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import { type EntriesForm, type Json, maybeWrapUndeclared } from "../../../e2e/gen-support.js"; -import { CUSTOM_PROPERTY_DEFINITIONS } from "../../../e2e/mock/state.js"; -import type { Rng } from "../../../e2e/prng.js"; +import { type EntriesForm, type Json, maybeWrapUndeclared } from "../../e2e/gen-support.js"; +import { CUSTOM_PROPERTY_DEFINITIONS } from "../../e2e/mock/state.js"; +import type { Rng } from "../../e2e/prng.js"; /** * Values are drawn ONLY from CUSTOM_PROPERTY_DEFINITIONS (the fixture the mock's PATCH handler diff --git a/test/src/sections/custom_properties/mock.ts b/test/sections/custom_properties/mock.ts similarity index 94% rename from test/src/sections/custom_properties/mock.ts rename to test/sections/custom_properties/mock.ts index aa321559..6ac0789a 100644 --- a/test/src/sections/custom_properties/mock.ts +++ b/test/sections/custom_properties/mock.ts @@ -2,7 +2,7 @@ * The custom_properties e2e mock fragment (registered in test/e2e/mock/sections.ts). */ -import { CUSTOM_PROPERTY_DEFINITIONS } from "../../../e2e/mock/state.js"; +import { CUSTOM_PROPERTY_DEFINITIONS } from "../../e2e/mock/state.js"; import { asObject, type Json, @@ -10,7 +10,7 @@ import { ok, orgProbeHandler, type SectionRestHandlers, -} from "../../../e2e/mock/support.js"; +} from "../../e2e/mock/support.js"; export const customPropertiesMockHandlers: SectionRestHandlers<"custom_properties"> = { "custom_properties.org": orgProbeHandler, diff --git a/test/src/sections/custom_properties/scenarios/custom-properties-apply-converges.yml b/test/sections/custom_properties/scenarios/custom-properties-apply-converges.yml similarity index 100% rename from test/src/sections/custom_properties/scenarios/custom-properties-apply-converges.yml rename to test/sections/custom_properties/scenarios/custom-properties-apply-converges.yml diff --git a/test/src/sections/custom_properties/scenarios/custom-properties-check-drift.yml b/test/sections/custom_properties/scenarios/custom-properties-check-drift.yml similarity index 100% rename from test/src/sections/custom_properties/scenarios/custom-properties-check-drift.yml rename to test/sections/custom_properties/scenarios/custom-properties-check-drift.yml diff --git a/test/src/sections/custom_properties/scenarios/custom-properties-personal-account.yml b/test/sections/custom_properties/scenarios/custom-properties-personal-account.yml similarity index 100% rename from test/src/sections/custom_properties/scenarios/custom-properties-personal-account.yml rename to test/sections/custom_properties/scenarios/custom-properties-personal-account.yml diff --git a/test/src/sections/custom_properties/scenarios/custom-properties-snapshot-roundtrip.yml b/test/sections/custom_properties/scenarios/custom-properties-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/custom_properties/scenarios/custom-properties-snapshot-roundtrip.yml rename to test/sections/custom_properties/scenarios/custom-properties-snapshot-roundtrip.yml diff --git a/test/src/sections/custom_properties/scenarios/custom-properties-undeclared-delete.yml b/test/sections/custom_properties/scenarios/custom-properties-undeclared-delete.yml similarity index 100% rename from test/src/sections/custom_properties/scenarios/custom-properties-undeclared-delete.yml rename to test/sections/custom_properties/scenarios/custom-properties-undeclared-delete.yml diff --git a/test/src/sections/custom_properties/scenarios/custom-properties-undeclared-keep-note.yml b/test/sections/custom_properties/scenarios/custom-properties-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/custom_properties/scenarios/custom-properties-undeclared-keep-note.yml rename to test/sections/custom_properties/scenarios/custom-properties-undeclared-keep-note.yml diff --git a/test/src/sections/custom_properties/scenarios/custom-properties-write-denied.yml b/test/sections/custom_properties/scenarios/custom-properties-write-denied.yml similarity index 100% rename from test/src/sections/custom_properties/scenarios/custom-properties-write-denied.yml rename to test/sections/custom_properties/scenarios/custom-properties-write-denied.yml diff --git a/test/src/sections/dependabot_secrets/mock.ts b/test/sections/dependabot_secrets/mock.ts similarity index 90% rename from test/src/sections/dependabot_secrets/mock.ts rename to test/sections/dependabot_secrets/mock.ts index 89ed8b1e..813c405e 100644 --- a/test/src/sections/dependabot_secrets/mock.ts +++ b/test/sections/dependabot_secrets/mock.ts @@ -3,7 +3,7 @@ * test/e2e/mock/support.ts. */ -import { repoSecretsRestHandlers, type SectionRestHandlers } from "../../../e2e/mock/support.js"; +import { repoSecretsRestHandlers, type SectionRestHandlers } from "../../e2e/mock/support.js"; export const dependabotSecretsMockHandlers: SectionRestHandlers<"dependabot_secrets"> = repoSecretsRestHandlers("dependabot_secrets"); diff --git a/test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-apply-converges.yml b/test/sections/dependabot_secrets/scenarios/dependabot-secrets-apply-converges.yml similarity index 100% rename from test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-apply-converges.yml rename to test/sections/dependabot_secrets/scenarios/dependabot-secrets-apply-converges.yml diff --git a/test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-check-drift.yml b/test/sections/dependabot_secrets/scenarios/dependabot-secrets-check-drift.yml similarity index 100% rename from test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-check-drift.yml rename to test/sections/dependabot_secrets/scenarios/dependabot-secrets-check-drift.yml diff --git a/test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-name-rejected.yml b/test/sections/dependabot_secrets/scenarios/dependabot-secrets-name-rejected.yml similarity index 100% rename from test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-name-rejected.yml rename to test/sections/dependabot_secrets/scenarios/dependabot-secrets-name-rejected.yml diff --git a/test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-snapshot-roundtrip.yml b/test/sections/dependabot_secrets/scenarios/dependabot-secrets-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-snapshot-roundtrip.yml rename to test/sections/dependabot_secrets/scenarios/dependabot-secrets-snapshot-roundtrip.yml diff --git a/test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-undeclared-delete.yml b/test/sections/dependabot_secrets/scenarios/dependabot-secrets-undeclared-delete.yml similarity index 100% rename from test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-undeclared-delete.yml rename to test/sections/dependabot_secrets/scenarios/dependabot-secrets-undeclared-delete.yml diff --git a/test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-undeclared-keep-note.yml b/test/sections/dependabot_secrets/scenarios/dependabot-secrets-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/dependabot_secrets/scenarios/dependabot-secrets-undeclared-keep-note.yml rename to test/sections/dependabot_secrets/scenarios/dependabot-secrets-undeclared-keep-note.yml diff --git a/test/src/sections/deploy_keys/deploy_keys.test.ts b/test/sections/deploy_keys/deploy_keys.test.ts similarity index 97% rename from test/src/sections/deploy_keys/deploy_keys.test.ts rename to test/sections/deploy_keys/deploy_keys.test.ts index 1aa23fc8..3fbc2a39 100644 --- a/test/src/sections/deploy_keys/deploy_keys.test.ts +++ b/test/sections/deploy_keys/deploy_keys.test.ts @@ -1,18 +1,18 @@ import { describe, expect, test } from "bun:test"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { planContext } from "../../../../src/sections/contract/plan.js"; -import { deployKeysSection } from "../../../../src/sections/deploy_keys/index.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { planContext } from "../../../src/sections/contract/plan.js"; +import { deployKeysSection } from "../../../src/sections/deploy_keys/index.js"; import { DeployKeyConfig, PUBLIC_KEY_ALGORITHMS, parsePublicKey, parseStoredKey, -} from "../../../../src/sections/deploy_keys/schema.js"; -import { MockApi } from "../../../mock-api.js"; -import { fragmentFake } from "../../../sections/fragment-fake.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +} from "../../../src/sections/deploy_keys/schema.js"; +import { MockApi } from "../../mock-api.js"; +import { fragmentFake } from "../fragment-fake.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; import { deployKeysMockHandlers } from "./mock.js"; const LIST = "GET /repos/o/r/keys?per_page=100&page=1"; diff --git a/test/src/sections/deploy_keys/generators.ts b/test/sections/deploy_keys/generators.ts similarity index 90% rename from test/src/sections/deploy_keys/generators.ts rename to test/sections/deploy_keys/generators.ts index 55baa0cb..23e81dca 100644 --- a/test/src/sections/deploy_keys/generators.ts +++ b/test/sections/deploy_keys/generators.ts @@ -2,8 +2,8 @@ * The deploy_keys fuzz generator fragment. */ -import { deployKeysSection } from "../../../../src/sections/deploy_keys/index.js"; -import { DeployKeyConfig } from "../../../../src/sections/deploy_keys/schema.js"; +import { deployKeysSection } from "../../../src/sections/deploy_keys/index.js"; +import { DeployKeyConfig } from "../../../src/sections/deploy_keys/schema.js"; import { generatorFromSlice, type Json, @@ -11,8 +11,8 @@ import { type LiveWitnessKind, lensWitness, uniqueBy, -} from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +} from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; /** * Each title owns one blob, DISTINCT from the others (GitHub rejects a reused public key with a 422, and the section diff --git a/test/src/sections/deploy_keys/mock.ts b/test/sections/deploy_keys/mock.ts similarity index 83% rename from test/src/sections/deploy_keys/mock.ts rename to test/sections/deploy_keys/mock.ts index 384368ff..3931904a 100644 --- a/test/src/sections/deploy_keys/mock.ts +++ b/test/sections/deploy_keys/mock.ts @@ -3,9 +3,9 @@ * test/e2e/mock/list-fragment.ts; only the server-owned facts live here. */ -import { deployKeysSection } from "../../../../src/sections/deploy_keys/index.js"; -import { type ListMockSpec, mockFragmentFor } from "../../../e2e/mock/list-fragment.js"; -import { type SectionRestHandlers, storedKeyMaterial } from "../../../e2e/mock/support.js"; +import { deployKeysSection } from "../../../src/sections/deploy_keys/index.js"; +import { type ListMockSpec, mockFragmentFor } from "../../e2e/mock/list-fragment.js"; +import { type SectionRestHandlers, storedKeyMaterial } from "../../e2e/mock/support.js"; /** * The material is stored comment-free the way GitHub normalizes it, the audit fields are fixed so a diff --git a/test/src/sections/deploy_keys/scenarios/deploy-keys-apply-converges.yml b/test/sections/deploy_keys/scenarios/deploy-keys-apply-converges.yml similarity index 100% rename from test/src/sections/deploy_keys/scenarios/deploy-keys-apply-converges.yml rename to test/sections/deploy_keys/scenarios/deploy-keys-apply-converges.yml diff --git a/test/src/sections/deploy_keys/scenarios/deploy-keys-check-drift.yml b/test/sections/deploy_keys/scenarios/deploy-keys-check-drift.yml similarity index 100% rename from test/src/sections/deploy_keys/scenarios/deploy-keys-check-drift.yml rename to test/sections/deploy_keys/scenarios/deploy-keys-check-drift.yml diff --git a/test/src/sections/deploy_keys/scenarios/deploy-keys-pem-block-rejected.yml b/test/sections/deploy_keys/scenarios/deploy-keys-pem-block-rejected.yml similarity index 100% rename from test/src/sections/deploy_keys/scenarios/deploy-keys-pem-block-rejected.yml rename to test/sections/deploy_keys/scenarios/deploy-keys-pem-block-rejected.yml diff --git a/test/src/sections/deploy_keys/scenarios/deploy-keys-snapshot-roundtrip.yml b/test/sections/deploy_keys/scenarios/deploy-keys-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/deploy_keys/scenarios/deploy-keys-snapshot-roundtrip.yml rename to test/sections/deploy_keys/scenarios/deploy-keys-snapshot-roundtrip.yml diff --git a/test/src/sections/deploy_keys/scenarios/deploy-keys-undeclared-delete.yml b/test/sections/deploy_keys/scenarios/deploy-keys-undeclared-delete.yml similarity index 100% rename from test/src/sections/deploy_keys/scenarios/deploy-keys-undeclared-delete.yml rename to test/sections/deploy_keys/scenarios/deploy-keys-undeclared-delete.yml diff --git a/test/src/sections/deploy_keys/scenarios/deploy-keys-undeclared-keep-note.yml b/test/sections/deploy_keys/scenarios/deploy-keys-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/deploy_keys/scenarios/deploy-keys-undeclared-keep-note.yml rename to test/sections/deploy_keys/scenarios/deploy-keys-undeclared-keep-note.yml diff --git a/test/src/sections/environments/environments.test.ts b/test/sections/environments/environments.test.ts similarity index 98% rename from test/src/sections/environments/environments.test.ts rename to test/sections/environments/environments.test.ts index 496aa89e..438dc8d1 100644 --- a/test/src/sections/environments/environments.test.ts +++ b/test/sections/environments/environments.test.ts @@ -1,26 +1,26 @@ import { describe, expect, test } from "bun:test"; -import { executePlan } from "../../../../src/engine/execute.js"; -import type { GitHubClient } from "../../../../src/github/api.js"; -import { planDrift, snapshotContext } from "../../../../src/sections/contract/plan.js"; +import { executePlan } from "../../../src/engine/execute.js"; +import type { GitHubClient } from "../../../src/github/api.js"; +import { planDrift, snapshotContext } from "../../../src/sections/contract/plan.js"; import { environmentsSection, flattenEnvironment, -} from "../../../../src/sections/environments/index.js"; +} from "../../../src/sections/environments/index.js"; import { EnvironmentConfig, type EnvironmentVariableConfig, -} from "../../../../src/sections/environments/schema.js"; -import { sharedSecretNotes, withPins } from "../../../../src/sections/environments/snapshot.js"; -import { projectOntoSchema } from "../../../../src/sections/shared/snapshot-helpers.js"; +} from "../../../src/sections/environments/schema.js"; +import { sharedSecretNotes, withPins } from "../../../src/sections/environments/snapshot.js"; +import { projectOntoSchema } from "../../../src/sections/shared/snapshot-helpers.js"; import { MOCK_SECRETS_PUBLIC_KEY, mockSodiumReady, unsealSecretValue, -} from "../../../e2e/mock/secrets.js"; -import { ENVIRONMENT_PARSE_FIXTURES } from "../../../fixtures/environment-parse-rules.js"; -import { MockApi, type Route } from "../../../mock-api.js"; -import { fragmentFake, registryFake } from "../../../sections/fragment-fake.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; +} from "../../e2e/mock/secrets.js"; +import { ENVIRONMENT_PARSE_FIXTURES } from "../../fixtures/environment-parse-rules.js"; +import { MockApi, type Route } from "../../mock-api.js"; +import { fragmentFake, registryFake } from "../fragment-fake.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; import { failureOf, NO_SECRETS, @@ -28,8 +28,8 @@ import { secretTools, sectionRunners, unwrap, -} from "../../../sections/section-run.js"; -import { proveSnapshotRoundTrip } from "../../../sections/snapshot-roundtrip.js"; +} from "../section-run.js"; +import { proveSnapshotRoundTrip } from "../snapshot-roundtrip.js"; import { environmentsMockHandlers } from "./mock.js"; const { plan, check, apply } = sectionRunners(environmentsSection); diff --git a/test/src/sections/environments/generators.ts b/test/sections/environments/generators.ts similarity index 95% rename from test/src/sections/environments/generators.ts rename to test/sections/environments/generators.ts index 061326bc..c96dcbe6 100644 --- a/test/src/sections/environments/generators.ts +++ b/test/sections/environments/generators.ts @@ -2,9 +2,9 @@ * The environments fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import { E2E_SECRET_ENV, type Json } from "../../../e2e/gen-support.js"; -import { PROTECTION_RULE_APPS } from "../../../e2e/mock/state.js"; -import type { Rng } from "../../../e2e/prng.js"; +import { E2E_SECRET_ENV, type Json } from "../../e2e/gen-support.js"; +import { PROTECTION_RULE_APPS } from "../../e2e/mock/state.js"; +import type { Rng } from "../../e2e/prng.js"; export function genEnvironments(rng: Rng): Json[] { // Each family's draws fork their own stream, so adding one never disturbs the main stream and diff --git a/test/src/sections/environments/mock.test.ts b/test/sections/environments/mock.test.ts similarity index 90% rename from test/src/sections/environments/mock.test.ts rename to test/sections/environments/mock.test.ts index 10b686d2..0d3d39bd 100644 --- a/test/src/sections/environments/mock.test.ts +++ b/test/sections/environments/mock.test.ts @@ -6,9 +6,9 @@ */ import { describe, expect, test } from "bun:test"; -import type { SectionEndpointKey } from "../../../../src/sections/registry.js"; -import { handlerTestContext } from "../../../e2e/mock/handler-test-ctx.js"; -import { buildState } from "../../../e2e/mock/state.js"; +import type { SectionEndpointKey } from "../../../src/sections/registry.js"; +import { handlerTestContext } from "../../e2e/mock/handler-test-ctx.js"; +import { buildState } from "../../e2e/mock/state.js"; import { environmentsMockHandlers } from "./mock.js"; const state = buildState( diff --git a/test/src/sections/environments/mock.ts b/test/sections/environments/mock.ts similarity index 97% rename from test/src/sections/environments/mock.ts rename to test/sections/environments/mock.ts index d1b8514c..fe838a15 100644 --- a/test/src/sections/environments/mock.ts +++ b/test/sections/environments/mock.ts @@ -5,17 +5,17 @@ * reorder -> the one mutation that renumbers, to contiguous 1..N */ -import { environmentsSection } from "../../../../src/sections/environments/index.js"; -import { MAX_PINNED_ENVIRONMENTS } from "../../../../src/sections/environments/schema.js"; -import { variableKey } from "../../../../src/sections/shared/variables-engine.js"; -import { mintNodeId } from "../../../e2e/mock/node-id.js"; -import { MOCK_SECRETS_KEY_ID, MOCK_SECRETS_PUBLIC_KEY } from "../../../e2e/mock/secrets.js"; +import { environmentsSection } from "../../../src/sections/environments/index.js"; +import { MAX_PINNED_ENVIRONMENTS } from "../../../src/sections/environments/schema.js"; +import { variableKey } from "../../../src/sections/shared/variables-engine.js"; +import { mintNodeId } from "../../e2e/mock/node-id.js"; +import { MOCK_SECRETS_KEY_ID, MOCK_SECRETS_PUBLIC_KEY } from "../../e2e/mock/secrets.js"; import { environmentFromPut, type MockState, named, PROTECTION_RULE_APPS, -} from "../../../e2e/mock/state.js"; +} from "../../e2e/mock/state.js"; import { asObject, branchPoliciesEnabled, @@ -31,7 +31,7 @@ import { secretsList, slicePage, variableName, -} from "../../../e2e/mock/support.js"; +} from "../../e2e/mock/support.js"; /** * The body a GET serves for one stored environment. Like GitHub, enabled custom protection rules diff --git a/test/src/sections/environments/pins.test.ts b/test/sections/environments/pins.test.ts similarity index 97% rename from test/src/sections/environments/pins.test.ts rename to test/sections/environments/pins.test.ts index 7c7c7a1b..8dba1663 100644 --- a/test/src/sections/environments/pins.test.ts +++ b/test/sections/environments/pins.test.ts @@ -1,11 +1,11 @@ import { describe, expect, test } from "bun:test"; -import { executePlan } from "../../../../src/engine/execute.js"; -import type { SectionFailure } from "../../../../src/sections/contract/errors.js"; -import { driftOf, planDrift } from "../../../../src/sections/contract/plan.js"; -import { environmentsSection } from "../../../../src/sections/environments/index.js"; -import { MAX_PINNED_ENVIRONMENTS } from "../../../../src/sections/environments/schema.js"; -import { MockApi } from "../../../mock-api.js"; -import { NO_SECRETS, REPO, sectionRunners } from "../../../sections/section-run.js"; +import { executePlan } from "../../../src/engine/execute.js"; +import type { SectionFailure } from "../../../src/sections/contract/errors.js"; +import { driftOf, planDrift } from "../../../src/sections/contract/plan.js"; +import { environmentsSection } from "../../../src/sections/environments/index.js"; +import { MAX_PINNED_ENVIRONMENTS } from "../../../src/sections/environments/schema.js"; +import { MockApi } from "../../mock-api.js"; +import { NO_SECRETS, REPO, sectionRunners } from "../section-run.js"; const { plan, check, apply } = sectionRunners(environmentsSection); diff --git a/test/src/sections/environments/scenarios/environment-branch-policies-check.yml b/test/sections/environments/scenarios/environment-branch-policies-check.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-branch-policies-check.yml rename to test/sections/environments/scenarios/environment-branch-policies-check.yml diff --git a/test/src/sections/environments/scenarios/environment-branch-policies-flag-required.yml b/test/sections/environments/scenarios/environment-branch-policies-flag-required.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-branch-policies-flag-required.yml rename to test/sections/environments/scenarios/environment-branch-policies-flag-required.yml diff --git a/test/src/sections/environments/scenarios/environment-branch-policies-read-denied.yml b/test/sections/environments/scenarios/environment-branch-policies-read-denied.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-branch-policies-read-denied.yml rename to test/sections/environments/scenarios/environment-branch-policies-read-denied.yml diff --git a/test/src/sections/environments/scenarios/environment-branch-policies-write-denied.yml b/test/sections/environments/scenarios/environment-branch-policies-write-denied.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-branch-policies-write-denied.yml rename to test/sections/environments/scenarios/environment-branch-policies-write-denied.yml diff --git a/test/src/sections/environments/scenarios/environment-branch-policies.yml b/test/sections/environments/scenarios/environment-branch-policies.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-branch-policies.yml rename to test/sections/environments/scenarios/environment-branch-policies.yml diff --git a/test/src/sections/environments/scenarios/environment-duplicate-secret-rejected-before-any-write.yml b/test/sections/environments/scenarios/environment-duplicate-secret-rejected-before-any-write.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-duplicate-secret-rejected-before-any-write.yml rename to test/sections/environments/scenarios/environment-duplicate-secret-rejected-before-any-write.yml diff --git a/test/src/sections/environments/scenarios/environment-every-parse-error-one-run.yml b/test/sections/environments/scenarios/environment-every-parse-error-one-run.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-every-parse-error-one-run.yml rename to test/sections/environments/scenarios/environment-every-parse-error-one-run.yml diff --git a/test/src/sections/environments/scenarios/environment-pins-apply-converges.yml b/test/sections/environments/scenarios/environment-pins-apply-converges.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-pins-apply-converges.yml rename to test/sections/environments/scenarios/environment-pins-apply-converges.yml diff --git a/test/src/sections/environments/scenarios/environment-pins-cap-live-blocked.yml b/test/sections/environments/scenarios/environment-pins-cap-live-blocked.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-pins-cap-live-blocked.yml rename to test/sections/environments/scenarios/environment-pins-cap-live-blocked.yml diff --git a/test/src/sections/environments/scenarios/environment-pins-cap-rejected.yml b/test/sections/environments/scenarios/environment-pins-cap-rejected.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-pins-cap-rejected.yml rename to test/sections/environments/scenarios/environment-pins-cap-rejected.yml diff --git a/test/src/sections/environments/scenarios/environment-pins-check-drift.yml b/test/sections/environments/scenarios/environment-pins-check-drift.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-pins-check-drift.yml rename to test/sections/environments/scenarios/environment-pins-check-drift.yml diff --git a/test/src/sections/environments/scenarios/environment-pins-holes-converge.yml b/test/sections/environments/scenarios/environment-pins-holes-converge.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-pins-holes-converge.yml rename to test/sections/environments/scenarios/environment-pins-holes-converge.yml diff --git a/test/src/sections/environments/scenarios/environment-protection-rules-check.yml b/test/sections/environments/scenarios/environment-protection-rules-check.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-protection-rules-check.yml rename to test/sections/environments/scenarios/environment-protection-rules-check.yml diff --git a/test/src/sections/environments/scenarios/environment-protection-rules-read-denied.yml b/test/sections/environments/scenarios/environment-protection-rules-read-denied.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-protection-rules-read-denied.yml rename to test/sections/environments/scenarios/environment-protection-rules-read-denied.yml diff --git a/test/src/sections/environments/scenarios/environment-protection-rules-unknown-app.yml b/test/sections/environments/scenarios/environment-protection-rules-unknown-app.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-protection-rules-unknown-app.yml rename to test/sections/environments/scenarios/environment-protection-rules-unknown-app.yml diff --git a/test/src/sections/environments/scenarios/environment-protection-rules-write-denied.yml b/test/sections/environments/scenarios/environment-protection-rules-write-denied.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-protection-rules-write-denied.yml rename to test/sections/environments/scenarios/environment-protection-rules-write-denied.yml diff --git a/test/src/sections/environments/scenarios/environment-protection-rules.yml b/test/sections/environments/scenarios/environment-protection-rules.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-protection-rules.yml rename to test/sections/environments/scenarios/environment-protection-rules.yml diff --git a/test/src/sections/environments/scenarios/environment-secrets-apply-converges.yml b/test/sections/environments/scenarios/environment-secrets-apply-converges.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-secrets-apply-converges.yml rename to test/sections/environments/scenarios/environment-secrets-apply-converges.yml diff --git a/test/src/sections/environments/scenarios/environment-secrets-check-drift.yml b/test/sections/environments/scenarios/environment-secrets-check-drift.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-secrets-check-drift.yml rename to test/sections/environments/scenarios/environment-secrets-check-drift.yml diff --git a/test/src/sections/environments/scenarios/environment-secrets-name-rejected.yml b/test/sections/environments/scenarios/environment-secrets-name-rejected.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-secrets-name-rejected.yml rename to test/sections/environments/scenarios/environment-secrets-name-rejected.yml diff --git a/test/src/sections/environments/scenarios/environment-secrets-undeclared-delete.yml b/test/sections/environments/scenarios/environment-secrets-undeclared-delete.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-secrets-undeclared-delete.yml rename to test/sections/environments/scenarios/environment-secrets-undeclared-delete.yml diff --git a/test/src/sections/environments/scenarios/environment-variables-apply-converges.yml b/test/sections/environments/scenarios/environment-variables-apply-converges.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-variables-apply-converges.yml rename to test/sections/environments/scenarios/environment-variables-apply-converges.yml diff --git a/test/src/sections/environments/scenarios/environment-variables-check-drift.yml b/test/sections/environments/scenarios/environment-variables-check-drift.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-variables-check-drift.yml rename to test/sections/environments/scenarios/environment-variables-check-drift.yml diff --git a/test/src/sections/environments/scenarios/environment-variables-name-rejected.yml b/test/sections/environments/scenarios/environment-variables-name-rejected.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-variables-name-rejected.yml rename to test/sections/environments/scenarios/environment-variables-name-rejected.yml diff --git a/test/src/sections/environments/scenarios/environment-variables-undeclared-keep-note.yml b/test/sections/environments/scenarios/environment-variables-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/environments/scenarios/environment-variables-undeclared-keep-note.yml rename to test/sections/environments/scenarios/environment-variables-undeclared-keep-note.yml diff --git a/test/src/sections/environments/scenarios/environments-apply-converges.yml b/test/sections/environments/scenarios/environments-apply-converges.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-apply-converges.yml rename to test/sections/environments/scenarios/environments-apply-converges.yml diff --git a/test/src/sections/environments/scenarios/environments-apply-empty-reviewers-converges.yml b/test/sections/environments/scenarios/environments-apply-empty-reviewers-converges.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-apply-empty-reviewers-converges.yml rename to test/sections/environments/scenarios/environments-apply-empty-reviewers-converges.yml diff --git a/test/src/sections/environments/scenarios/environments-apply-omitted-reviewers-refused.yml b/test/sections/environments/scenarios/environments-apply-omitted-reviewers-refused.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-apply-omitted-reviewers-refused.yml rename to test/sections/environments/scenarios/environments-apply-omitted-reviewers-refused.yml diff --git a/test/src/sections/environments/scenarios/environments-apply-turns-reviewers-off.yml b/test/sections/environments/scenarios/environments-apply-turns-reviewers-off.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-apply-turns-reviewers-off.yml rename to test/sections/environments/scenarios/environments-apply-turns-reviewers-off.yml diff --git a/test/src/sections/environments/scenarios/environments-branch-policy-absent-converges.yml b/test/sections/environments/scenarios/environments-branch-policy-absent-converges.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-branch-policy-absent-converges.yml rename to test/sections/environments/scenarios/environments-branch-policy-absent-converges.yml diff --git a/test/src/sections/environments/scenarios/environments-branch-policy-both-flags-off-rejected.yml b/test/sections/environments/scenarios/environments-branch-policy-both-flags-off-rejected.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-branch-policy-both-flags-off-rejected.yml rename to test/sections/environments/scenarios/environments-branch-policy-both-flags-off-rejected.yml diff --git a/test/src/sections/environments/scenarios/environments-check-drift.yml b/test/sections/environments/scenarios/environments-check-drift.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-check-drift.yml rename to test/sections/environments/scenarios/environments-check-drift.yml diff --git a/test/src/sections/environments/scenarios/environments-check-omitted-reviewers.yml b/test/sections/environments/scenarios/environments-check-omitted-reviewers.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-check-omitted-reviewers.yml rename to test/sections/environments/scenarios/environments-check-omitted-reviewers.yml diff --git a/test/src/sections/environments/scenarios/environments-declared-off-matches-unprotected.yml b/test/sections/environments/scenarios/environments-declared-off-matches-unprotected.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-declared-off-matches-unprotected.yml rename to test/sections/environments/scenarios/environments-declared-off-matches-unprotected.yml diff --git a/test/src/sections/environments/scenarios/environments-name-case-folds-to-live.yml b/test/sections/environments/scenarios/environments-name-case-folds-to-live.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-name-case-folds-to-live.yml rename to test/sections/environments/scenarios/environments-name-case-folds-to-live.yml diff --git a/test/src/sections/environments/scenarios/environments-rest-only-no-graphql.yml b/test/sections/environments/scenarios/environments-rest-only-no-graphql.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-rest-only-no-graphql.yml rename to test/sections/environments/scenarios/environments-rest-only-no-graphql.yml diff --git a/test/src/sections/environments/scenarios/environments-snapshot-roundtrip.yml b/test/sections/environments/scenarios/environments-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/environments/scenarios/environments-snapshot-roundtrip.yml rename to test/sections/environments/scenarios/environments-snapshot-roundtrip.yml diff --git a/test/src/sections/interaction_limits/generators.ts b/test/sections/interaction_limits/generators.ts similarity index 94% rename from test/src/sections/interaction_limits/generators.ts rename to test/sections/interaction_limits/generators.ts index 62140463..fbbf80b8 100644 --- a/test/src/sections/interaction_limits/generators.ts +++ b/test/sections/interaction_limits/generators.ts @@ -2,8 +2,8 @@ * The interaction_limits fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import type { Json } from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +import type { Json } from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; export function genInteractionLimits(rng: Rng): Json | null { if (rng.bool(0.2)) { diff --git a/test/src/sections/interaction_limits/interaction_limits.test.ts b/test/sections/interaction_limits/interaction_limits.test.ts similarity index 95% rename from test/src/sections/interaction_limits/interaction_limits.test.ts rename to test/sections/interaction_limits/interaction_limits.test.ts index a908601c..ea209436 100644 --- a/test/src/sections/interaction_limits/interaction_limits.test.ts +++ b/test/sections/interaction_limits/interaction_limits.test.ts @@ -1,14 +1,14 @@ import { describe, expect, test } from "bun:test"; -import { executePlan } from "../../../../src/engine/execute.js"; -import type { GitHubClient } from "../../../../src/github/api.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { type PlannedOp, planContext } from "../../../../src/sections/contract/plan.js"; -import { interactionLimitsSection } from "../../../../src/sections/interaction_limits/index.js"; -import type { InteractionLimitsConfig } from "../../../../src/sections/interaction_limits/schema.js"; -import { MockApi } from "../../../mock-api.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { deniedDetail, REPO, SectionFailed, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import { executePlan } from "../../../src/engine/execute.js"; +import type { GitHubClient } from "../../../src/github/api.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { type PlannedOp, planContext } from "../../../src/sections/contract/plan.js"; +import { interactionLimitsSection } from "../../../src/sections/interaction_limits/index.js"; +import type { InteractionLimitsConfig } from "../../../src/sections/interaction_limits/schema.js"; +import { MockApi } from "../../mock-api.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { deniedDetail, REPO, SectionFailed, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; const BASE = "/repos/o/r/interaction-limits"; const GET = `GET ${BASE}`; diff --git a/test/src/sections/interaction_limits/mock.test.ts b/test/sections/interaction_limits/mock.test.ts similarity index 90% rename from test/src/sections/interaction_limits/mock.test.ts rename to test/sections/interaction_limits/mock.test.ts index ad2630e4..ef0d0c0c 100644 --- a/test/src/sections/interaction_limits/mock.test.ts +++ b/test/sections/interaction_limits/mock.test.ts @@ -4,8 +4,8 @@ */ import { describe, expect, test } from "bun:test"; -import { handlerTestContext } from "../../../e2e/mock/handler-test-ctx.js"; -import { buildStateForSlug, type MockState } from "../../../e2e/mock/state.js"; +import { handlerTestContext } from "../../e2e/mock/handler-test-ctx.js"; +import { buildStateForSlug, type MockState } from "../../e2e/mock/state.js"; import { interactionLimitsMockHandlers } from "./mock.js"; function stateWith(logins: string[]): MockState { diff --git a/test/src/sections/interaction_limits/mock.ts b/test/sections/interaction_limits/mock.ts similarity index 95% rename from test/src/sections/interaction_limits/mock.ts rename to test/sections/interaction_limits/mock.ts index 3ccc5ec6..65a9d33b 100644 --- a/test/src/sections/interaction_limits/mock.ts +++ b/test/sections/interaction_limits/mock.ts @@ -2,8 +2,8 @@ * The interaction_limits e2e mock fragment (aggregated in test/e2e/mock/sections.ts). */ -import { BYPASS_MAX } from "../../../../src/sections/interaction_limits/schema.js"; -import { bypassUser } from "../../../e2e/mock/state.js"; +import { BYPASS_MAX } from "../../../src/sections/interaction_limits/schema.js"; +import { bypassUser } from "../../e2e/mock/state.js"; import { asObject, bypassLogins, @@ -15,7 +15,7 @@ import { ok, type SectionRestHandlers, sameLogin, -} from "../../../e2e/mock/support.js"; +} from "../../e2e/mock/support.js"; export const interactionLimitsMockHandlers: SectionRestHandlers<"interaction_limits"> = { "interaction_limits.get": ({ state }) => diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-apply-converges.yml b/test/sections/interaction_limits/scenarios/interaction-limits-apply-converges.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-apply-converges.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-apply-converges.yml diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-bypass-add-remove.yml b/test/sections/interaction_limits/scenarios/interaction-limits-bypass-add-remove.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-bypass-add-remove.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-bypass-add-remove.yml diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-bypass-full-list-swap.yml b/test/sections/interaction_limits/scenarios/interaction-limits-bypass-full-list-swap.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-bypass-full-list-swap.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-bypass-full-list-swap.yml diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-cap-apply-converges.yml b/test/sections/interaction_limits/scenarios/interaction-limits-cap-apply-converges.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-cap-apply-converges.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-cap-apply-converges.yml diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-cap-check-drift.yml b/test/sections/interaction_limits/scenarios/interaction-limits-cap-check-drift.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-cap-check-drift.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-cap-check-drift.yml diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-cap-unavailable-405.yml b/test/sections/interaction_limits/scenarios/interaction-limits-cap-unavailable-405.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-cap-unavailable-405.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-cap-unavailable-405.yml diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-check-drift.yml b/test/sections/interaction_limits/scenarios/interaction-limits-check-drift.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-check-drift.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-check-drift.yml diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-check-org-override.yml b/test/sections/interaction_limits/scenarios/interaction-limits-check-org-override.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-check-org-override.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-check-org-override.yml diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-clear-apply.yml b/test/sections/interaction_limits/scenarios/interaction-limits-clear-apply.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-clear-apply.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-clear-apply.yml diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-invalid-values-and-unknown-key-rejected.yml b/test/sections/interaction_limits/scenarios/interaction-limits-invalid-values-and-unknown-key-rejected.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-invalid-values-and-unknown-key-rejected.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-invalid-values-and-unknown-key-rejected.yml diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-org-override-note.yml b/test/sections/interaction_limits/scenarios/interaction-limits-org-override-note.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-org-override-note.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-org-override-note.yml diff --git a/test/src/sections/interaction_limits/scenarios/interaction-limits-snapshot-roundtrip.yml b/test/sections/interaction_limits/scenarios/interaction-limits-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/interaction_limits/scenarios/interaction-limits-snapshot-roundtrip.yml rename to test/sections/interaction_limits/scenarios/interaction-limits-snapshot-roundtrip.yml diff --git a/test/sections/interaction-limits-schema.test.ts b/test/sections/interaction_limits/schema.test.ts similarity index 97% rename from test/sections/interaction-limits-schema.test.ts rename to test/sections/interaction_limits/schema.test.ts index e5b0e8df..e614f325 100644 --- a/test/sections/interaction-limits-schema.test.ts +++ b/test/sections/interaction_limits/schema.test.ts @@ -7,8 +7,8 @@ */ import { describe, expect, test } from "bun:test"; -import { validateSectionShapes } from "../../src/engine/validate.js"; -import { interactionLimitsSection } from "../../src/sections/interaction_limits/index.js"; +import { validateSectionShapes } from "../../../src/engine/validate.js"; +import { interactionLimitsSection } from "../../../src/sections/interaction_limits/index.js"; function verdict(interactionLimits: unknown): { ok: true } | { issues: readonly string[] } { return validateSectionShapes({ interaction_limits: interactionLimits }, "settings.yml").match( diff --git a/test/src/sections/labels/generators.ts b/test/sections/labels/generators.ts similarity index 83% rename from test/src/sections/labels/generators.ts rename to test/sections/labels/generators.ts index 147ac805..8f5c92da 100644 --- a/test/src/sections/labels/generators.ts +++ b/test/sections/labels/generators.ts @@ -2,8 +2,8 @@ * The labels fuzz generator fragment. */ -import { labelsSection, nameKey } from "../../../../src/sections/labels/index.js"; -import { LabelConfig } from "../../../../src/sections/labels/schema.js"; +import { labelsSection, nameKey } from "../../../src/sections/labels/index.js"; +import { LabelConfig } from "../../../src/sections/labels/schema.js"; import { generatorFromSlice, genName, @@ -12,8 +12,8 @@ import { type LiveWitnessKind, lensWitness, uniqueBy, -} from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +} from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; const HEX_COLORS = ["d73a4a", "a2eeef", "ededed", "0e8a16", "ffffff", "000000"] as const; diff --git a/test/src/sections/labels/labels.test.ts b/test/sections/labels/labels.test.ts similarity index 91% rename from test/src/sections/labels/labels.test.ts rename to test/sections/labels/labels.test.ts index 429e8c7c..b878acbe 100644 --- a/test/src/sections/labels/labels.test.ts +++ b/test/sections/labels/labels.test.ts @@ -1,11 +1,11 @@ import { describe, expect, test } from "bun:test"; -import { executePlan } from "../../../../src/engine/execute.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { planContext } from "../../../../src/sections/contract/plan.js"; -import { labelsSection } from "../../../../src/sections/labels/index.js"; -import { MockApi } from "../../../mock-api.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import { executePlan } from "../../../src/engine/execute.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { planContext } from "../../../src/sections/contract/plan.js"; +import { labelsSection } from "../../../src/sections/labels/index.js"; +import { MockApi } from "../../mock-api.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; const LIST = "GET /repos/o/r/labels?per_page=100&page=1"; const liveLabels = [ diff --git a/test/src/sections/labels/mock.test.ts b/test/sections/labels/mock.test.ts similarity index 93% rename from test/src/sections/labels/mock.test.ts rename to test/sections/labels/mock.test.ts index b6ce32af..a1a2e111 100644 --- a/test/src/sections/labels/mock.test.ts +++ b/test/sections/labels/mock.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect, test } from "bun:test"; -import { handlerTestContext } from "../../../e2e/mock/handler-test-ctx.js"; -import { buildStateForSlug, type MockState } from "../../../e2e/mock/state.js"; +import { handlerTestContext } from "../../e2e/mock/handler-test-ctx.js"; +import { buildStateForSlug, type MockState } from "../../e2e/mock/state.js"; import { labelsMockHandlers } from "./mock.js"; function create(state: MockState, body: Record): Record { diff --git a/test/src/sections/labels/mock.ts b/test/sections/labels/mock.ts similarity index 72% rename from test/src/sections/labels/mock.ts rename to test/sections/labels/mock.ts index c29b6947..d64bde7f 100644 --- a/test/src/sections/labels/mock.ts +++ b/test/sections/labels/mock.ts @@ -3,9 +3,9 @@ * test/e2e/mock/list-fragment.ts; only the server-owned facts live here. */ -import { labelsSection } from "../../../../src/sections/labels/index.js"; -import { type ListMockSpec, mockFragmentFor } from "../../../e2e/mock/list-fragment.js"; -import type { SectionRestHandlers } from "../../../e2e/mock/support.js"; +import { labelsSection } from "../../../src/sections/labels/index.js"; +import { type ListMockSpec, mockFragmentFor } from "../../e2e/mock/list-fragment.js"; +import type { SectionRestHandlers } from "../../e2e/mock/support.js"; export const LABELS_MOCK: ListMockSpec = { collection: (state) => state.labels, diff --git a/test/src/sections/labels/scenarios/labels-apply-converges.yml b/test/sections/labels/scenarios/labels-apply-converges.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-apply-converges.yml rename to test/sections/labels/scenarios/labels-apply-converges.yml diff --git a/test/src/sections/labels/scenarios/labels-apply-rename.yml b/test/sections/labels/scenarios/labels-apply-rename.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-apply-rename.yml rename to test/sections/labels/scenarios/labels-apply-rename.yml diff --git a/test/src/sections/labels/scenarios/labels-check-drift.yml b/test/sections/labels/scenarios/labels-check-drift.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-check-drift.yml rename to test/sections/labels/scenarios/labels-check-drift.yml diff --git a/test/src/sections/labels/scenarios/labels-duplicate-rejected-before-any-write.yml b/test/sections/labels/scenarios/labels-duplicate-rejected-before-any-write.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-duplicate-rejected-before-any-write.yml rename to test/sections/labels/scenarios/labels-duplicate-rejected-before-any-write.yml diff --git a/test/src/sections/labels/scenarios/labels-invalid-color-and-long-description-rejected.yml b/test/sections/labels/scenarios/labels-invalid-color-and-long-description-rejected.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-invalid-color-and-long-description-rejected.yml rename to test/sections/labels/scenarios/labels-invalid-color-and-long-description-rejected.yml diff --git a/test/src/sections/labels/scenarios/labels-network-drop.yml b/test/sections/labels/scenarios/labels-network-drop.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-network-drop.yml rename to test/sections/labels/scenarios/labels-network-drop.yml diff --git a/test/src/sections/labels/scenarios/labels-pagination.yml b/test/sections/labels/scenarios/labels-pagination.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-pagination.yml rename to test/sections/labels/scenarios/labels-pagination.yml diff --git a/test/src/sections/labels/scenarios/labels-rate-limit-classification.yml b/test/sections/labels/scenarios/labels-rate-limit-classification.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-rate-limit-classification.yml rename to test/sections/labels/scenarios/labels-rate-limit-classification.yml diff --git a/test/src/sections/labels/scenarios/labels-remove-rejected-in-single-document.yml b/test/sections/labels/scenarios/labels-remove-rejected-in-single-document.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-remove-rejected-in-single-document.yml rename to test/sections/labels/scenarios/labels-remove-rejected-in-single-document.yml diff --git a/test/src/sections/labels/scenarios/labels-retry-429-then-200.yml b/test/sections/labels/scenarios/labels-retry-429-then-200.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-retry-429-then-200.yml rename to test/sections/labels/scenarios/labels-retry-429-then-200.yml diff --git a/test/src/sections/labels/scenarios/labels-snapshot-roundtrip.yml b/test/sections/labels/scenarios/labels-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-snapshot-roundtrip.yml rename to test/sections/labels/scenarios/labels-snapshot-roundtrip.yml diff --git a/test/src/sections/labels/scenarios/labels-undeclared-delete.yml b/test/sections/labels/scenarios/labels-undeclared-delete.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-undeclared-delete.yml rename to test/sections/labels/scenarios/labels-undeclared-delete.yml diff --git a/test/src/sections/labels/scenarios/labels-undeclared-keep-note.yml b/test/sections/labels/scenarios/labels-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/labels/scenarios/labels-undeclared-keep-note.yml rename to test/sections/labels/scenarios/labels-undeclared-keep-note.yml diff --git a/test/sections/labels-schema.test.ts b/test/sections/labels/schema.test.ts similarity index 97% rename from test/sections/labels-schema.test.ts rename to test/sections/labels/schema.test.ts index 3d6933e3..2b9a6fc0 100644 --- a/test/sections/labels-schema.test.ts +++ b/test/sections/labels/schema.test.ts @@ -5,7 +5,7 @@ */ import { describe, expect, test } from "bun:test"; -import { validateSectionShapes } from "../../src/engine/validate.js"; +import { validateSectionShapes } from "../../../src/engine/validate.js"; function verdict(label: Record): { ok: true } | { issues: readonly string[] } { return validateSectionShapes({ labels: [label] }, "settings.yml").match( diff --git a/test/sections/list-section.test.ts b/test/sections/list-section.test.ts index bb34fdf8..bbf5745e 100644 --- a/test/sections/list-section.test.ts +++ b/test/sections/list-section.test.ts @@ -21,8 +21,8 @@ import { generatorFromSlice, uniqueBy } from "../e2e/gen-support.js"; import { mockFragmentFor } from "../e2e/mock/list-fragment.js"; import { Rng } from "../e2e/prng.js"; import { MockApi } from "../mock-api.js"; -import { LABELS_MOCK } from "../src/sections/labels/mock.js"; import { fragmentFake } from "./fragment-fake.js"; +import { LABELS_MOCK } from "./labels/mock.js"; import { provePlanIdempotent } from "./plan-idempotence.js"; import { failureOf, REPO, unwrap } from "./section-run.js"; import { validatedInput } from "./validated-input.js"; diff --git a/test/src/sections/milestones/generators.ts b/test/sections/milestones/generators.ts similarity index 93% rename from test/src/sections/milestones/generators.ts rename to test/sections/milestones/generators.ts index 37acff8d..4a83afad 100644 --- a/test/src/sections/milestones/generators.ts +++ b/test/sections/milestones/generators.ts @@ -2,8 +2,8 @@ * The milestones fuzz generator fragment and witness. */ -import { dueOnWire } from "../../../../src/sections/milestones/index.js"; -import { MilestoneConfig } from "../../../../src/sections/milestones/schema.js"; +import { dueOnWire } from "../../../src/sections/milestones/index.js"; +import { MilestoneConfig } from "../../../src/sections/milestones/schema.js"; import { assertSentinelDisjoint, DRIFT_DESCRIPTION, @@ -13,8 +13,8 @@ import { type LiveWitness, type LiveWitnessKind, uniqueBy, -} from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +} from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; import { githubStoresDueOn } from "./mock.js"; /** A fixed pool, never Date.now, so generation stays deterministic; one day per DST state and one at the year's edge. */ diff --git a/test/src/sections/milestones/milestones.test.ts b/test/sections/milestones/milestones.test.ts similarity index 92% rename from test/src/sections/milestones/milestones.test.ts rename to test/sections/milestones/milestones.test.ts index 6d2601cf..2d321f3b 100644 --- a/test/src/sections/milestones/milestones.test.ts +++ b/test/sections/milestones/milestones.test.ts @@ -1,12 +1,12 @@ import { describe, expect, test } from "bun:test"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { planContext } from "../../../../src/sections/contract/plan.js"; -import { milestonesSection } from "../../../../src/sections/milestones/index.js"; -import { MockApi } from "../../../mock-api.js"; -import { fragmentFake } from "../../../sections/fragment-fake.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { planContext } from "../../../src/sections/contract/plan.js"; +import { milestonesSection } from "../../../src/sections/milestones/index.js"; +import { MockApi } from "../../mock-api.js"; +import { fragmentFake } from "../fragment-fake.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; import { githubStoresDueOn, milestonesMockHandlers } from "./mock.js"; /** Closed milestones are listed too: the read asks for state=all. */ diff --git a/test/src/sections/milestones/mock.test.ts b/test/sections/milestones/mock.test.ts similarity index 93% rename from test/src/sections/milestones/mock.test.ts rename to test/sections/milestones/mock.test.ts index c31146b4..d4780203 100644 --- a/test/src/sections/milestones/mock.test.ts +++ b/test/sections/milestones/mock.test.ts @@ -4,8 +4,8 @@ */ import { describe, expect, test } from "bun:test"; -import { handlerTestContext } from "../../../e2e/mock/handler-test-ctx.js"; -import { buildStateForSlug, type MockState } from "../../../e2e/mock/state.js"; +import { handlerTestContext } from "../../e2e/mock/handler-test-ctx.js"; +import { buildStateForSlug, type MockState } from "../../e2e/mock/state.js"; import { milestonesMockHandlers } from "./mock.js"; function create(state: MockState, body: Record): Record { diff --git a/test/src/sections/milestones/mock.ts b/test/sections/milestones/mock.ts similarity index 87% rename from test/src/sections/milestones/mock.ts rename to test/sections/milestones/mock.ts index bf9bc935..98f94c34 100644 --- a/test/src/sections/milestones/mock.ts +++ b/test/sections/milestones/mock.ts @@ -3,9 +3,9 @@ * test/e2e/mock/list-fragment.ts; only the server-owned facts live here. */ -import { milestonesSection } from "../../../../src/sections/milestones/index.js"; -import { type ListMockSpec, mockFragmentFor } from "../../../e2e/mock/list-fragment.js"; -import { nextNumber, type SectionRestHandlers } from "../../../e2e/mock/support.js"; +import { milestonesSection } from "../../../src/sections/milestones/index.js"; +import { type ListMockSpec, mockFragmentFor } from "../../e2e/mock/list-fragment.js"; +import { nextNumber, type SectionRestHandlers } from "../../e2e/mock/support.js"; const PACIFIC = "America/Los_Angeles"; const pacificDay = new Intl.DateTimeFormat("en-CA", { diff --git a/test/src/sections/milestones/scenarios/milestones-apply-converges.yml b/test/sections/milestones/scenarios/milestones-apply-converges.yml similarity index 100% rename from test/src/sections/milestones/scenarios/milestones-apply-converges.yml rename to test/sections/milestones/scenarios/milestones-apply-converges.yml diff --git a/test/src/sections/milestones/scenarios/milestones-check-drift.yml b/test/sections/milestones/scenarios/milestones-check-drift.yml similarity index 100% rename from test/src/sections/milestones/scenarios/milestones-check-drift.yml rename to test/sections/milestones/scenarios/milestones-check-drift.yml diff --git a/test/src/sections/milestones/scenarios/milestones-due-on-day-changes.yml b/test/sections/milestones/scenarios/milestones-due-on-day-changes.yml similarity index 100% rename from test/src/sections/milestones/scenarios/milestones-due-on-day-changes.yml rename to test/sections/milestones/scenarios/milestones-due-on-day-changes.yml diff --git a/test/src/sections/milestones/scenarios/milestones-due-on-day-converges.yml b/test/sections/milestones/scenarios/milestones-due-on-day-converges.yml similarity index 100% rename from test/src/sections/milestones/scenarios/milestones-due-on-day-converges.yml rename to test/sections/milestones/scenarios/milestones-due-on-day-converges.yml diff --git a/test/src/sections/milestones/scenarios/milestones-snapshot-roundtrip.yml b/test/sections/milestones/scenarios/milestones-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/milestones/scenarios/milestones-snapshot-roundtrip.yml rename to test/sections/milestones/scenarios/milestones-snapshot-roundtrip.yml diff --git a/test/src/sections/milestones/scenarios/milestones-undeclared-delete.yml b/test/sections/milestones/scenarios/milestones-undeclared-delete.yml similarity index 100% rename from test/src/sections/milestones/scenarios/milestones-undeclared-delete.yml rename to test/sections/milestones/scenarios/milestones-undeclared-delete.yml diff --git a/test/src/sections/milestones/scenarios/milestones-undeclared-keep-note.yml b/test/sections/milestones/scenarios/milestones-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/milestones/scenarios/milestones-undeclared-keep-note.yml rename to test/sections/milestones/scenarios/milestones-undeclared-keep-note.yml diff --git a/test/src/sections/pages/generators.ts b/test/sections/pages/generators.ts similarity index 82% rename from test/src/sections/pages/generators.ts rename to test/sections/pages/generators.ts index 3071de68..2036fe72 100644 --- a/test/src/sections/pages/generators.ts +++ b/test/sections/pages/generators.ts @@ -2,8 +2,8 @@ * The pages fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import type { Json } from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +import type { Json } from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; export function genPages(rng: Rng): Json | null { if (rng.bool(0.25)) { diff --git a/test/src/sections/pages/mock.test.ts b/test/sections/pages/mock.test.ts similarity index 94% rename from test/src/sections/pages/mock.test.ts rename to test/sections/pages/mock.test.ts index 74e1d587..c1d63297 100644 --- a/test/src/sections/pages/mock.test.ts +++ b/test/sections/pages/mock.test.ts @@ -4,8 +4,8 @@ */ import { describe, expect, test } from "bun:test"; -import { handlerTestContext } from "../../../e2e/mock/handler-test-ctx.js"; -import { buildStateForSlug, type MockState } from "../../../e2e/mock/state.js"; +import { handlerTestContext } from "../../e2e/mock/handler-test-ctx.js"; +import { buildStateForSlug, type MockState } from "../../e2e/mock/state.js"; import { pagesMockHandlers } from "./mock.js"; // The fragment's exact key union makes a typo'd key a compile error, so no runtime not-found guard is needed. diff --git a/test/src/sections/pages/mock.ts b/test/sections/pages/mock.ts similarity index 98% rename from test/src/sections/pages/mock.ts rename to test/sections/pages/mock.ts index a7d477e3..8e4ac355 100644 --- a/test/src/sections/pages/mock.ts +++ b/test/sections/pages/mock.ts @@ -9,7 +9,7 @@ import { ok, pagesUrl, type SectionRestHandlers, -} from "../../../e2e/mock/support.js"; +} from "../../e2e/mock/support.js"; /** * The create and update bodies GitHub documents; anything else on the wire is dropped, as github.com diff --git a/test/src/sections/pages/pages.test.ts b/test/sections/pages/pages.test.ts similarity index 94% rename from test/src/sections/pages/pages.test.ts rename to test/sections/pages/pages.test.ts index c2534899..59e32ef3 100644 --- a/test/src/sections/pages/pages.test.ts +++ b/test/sections/pages/pages.test.ts @@ -1,12 +1,12 @@ import { describe, expect, test } from "bun:test"; -import type { GitHubClient } from "../../../../src/github/api.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { planContext } from "../../../../src/sections/contract/plan.js"; -import { pagesSection } from "../../../../src/sections/pages/index.js"; -import { MockApi } from "../../../mock-api.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import type { GitHubClient } from "../../../src/github/api.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { planContext } from "../../../src/sections/contract/plan.js"; +import { pagesSection } from "../../../src/sections/pages/index.js"; +import { MockApi } from "../../mock-api.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; const GET = "GET /repos/o/r/pages"; diff --git a/test/src/sections/pages/scenarios/pages-apply-converges.yml b/test/sections/pages/scenarios/pages-apply-converges.yml similarity index 100% rename from test/src/sections/pages/scenarios/pages-apply-converges.yml rename to test/sections/pages/scenarios/pages-apply-converges.yml diff --git a/test/src/sections/pages/scenarios/pages-check-drift.yml b/test/sections/pages/scenarios/pages-check-drift.yml similarity index 100% rename from test/src/sections/pages/scenarios/pages-check-drift.yml rename to test/sections/pages/scenarios/pages-check-drift.yml diff --git a/test/src/sections/pages/scenarios/pages-create-then-update.yml b/test/sections/pages/scenarios/pages-create-then-update.yml similarity index 100% rename from test/src/sections/pages/scenarios/pages-create-then-update.yml rename to test/sections/pages/scenarios/pages-create-then-update.yml diff --git a/test/src/sections/pages/scenarios/pages-null-disable.yml b/test/sections/pages/scenarios/pages-null-disable.yml similarity index 100% rename from test/src/sections/pages/scenarios/pages-null-disable.yml rename to test/sections/pages/scenarios/pages-null-disable.yml diff --git a/test/src/sections/pages/scenarios/pages-read-only-field-rejected.yml b/test/sections/pages/scenarios/pages-read-only-field-rejected.yml similarity index 100% rename from test/src/sections/pages/scenarios/pages-read-only-field-rejected.yml rename to test/sections/pages/scenarios/pages-read-only-field-rejected.yml diff --git a/test/src/sections/pages/scenarios/pages-site-key-absent-converges.yml b/test/sections/pages/scenarios/pages-site-key-absent-converges.yml similarity index 100% rename from test/src/sections/pages/scenarios/pages-site-key-absent-converges.yml rename to test/sections/pages/scenarios/pages-site-key-absent-converges.yml diff --git a/test/src/sections/pages/scenarios/pages-snapshot-roundtrip.yml b/test/sections/pages/scenarios/pages-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/pages/scenarios/pages-snapshot-roundtrip.yml rename to test/sections/pages/scenarios/pages-snapshot-roundtrip.yml diff --git a/test/src/sections/pages/scenarios/pages-unknown-key-noted.yml b/test/sections/pages/scenarios/pages-unknown-key-noted.yml similarity index 100% rename from test/src/sections/pages/scenarios/pages-unknown-key-noted.yml rename to test/sections/pages/scenarios/pages-unknown-key-noted.yml diff --git a/test/src/sections/repository/generators.ts b/test/sections/repository/generators.ts similarity index 94% rename from test/src/sections/repository/generators.ts rename to test/sections/repository/generators.ts index 471801c8..4f263e95 100644 --- a/test/src/sections/repository/generators.ts +++ b/test/sections/repository/generators.ts @@ -2,8 +2,8 @@ * The repository fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import type { Json } from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +import type { Json } from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; export function genRepository(rng: Rng): Json { const repo: Json = {}; diff --git a/test/src/sections/repository/mock.ts b/test/sections/repository/mock.ts similarity index 97% rename from test/src/sections/repository/mock.ts rename to test/sections/repository/mock.ts index 4e4bb305..5005d07f 100644 --- a/test/src/sections/repository/mock.ts +++ b/test/sections/repository/mock.ts @@ -2,8 +2,8 @@ * The repository e2e mock fragment (aggregated in test/e2e/mock/sections.ts). */ -import { decodeNodeId } from "../../../e2e/mock/node-id.js"; -import { restRepoSurface } from "../../../e2e/mock/state.js"; +import { decodeNodeId } from "../../e2e/mock/node-id.js"; +import { restRepoSurface } from "../../e2e/mock/state.js"; import { asObject, booleanToggleGet, @@ -14,7 +14,7 @@ import { repoNodeId, type SectionGraphqlHandlers, type SectionRestHandlers, -} from "../../../e2e/mock/support.js"; +} from "../../e2e/mock/support.js"; // Every repo body a REST handler serves, and the PATCH body it accepts, goes through // restRepoSurface, which strips the GraphQL-only fields, so the REST paths stay as blind to them as GitHub's. diff --git a/test/src/sections/repository/repository.test.ts b/test/sections/repository/repository.test.ts similarity index 98% rename from test/src/sections/repository/repository.test.ts rename to test/sections/repository/repository.test.ts index 588d6f04..3b8b4496 100644 --- a/test/src/sections/repository/repository.test.ts +++ b/test/sections/repository/repository.test.ts @@ -1,26 +1,26 @@ import { describe, expect, test } from "bun:test"; import { z } from "zod"; -import { executePlan } from "../../../../src/engine/execute.js"; -import { validateSectionShapes } from "../../../../src/engine/validate.js"; -import type { GitHubClient } from "../../../../src/github/api.js"; -import { describeProblem } from "../../../../src/problem.js"; -import type { SectionFailure } from "../../../../src/sections/contract/errors.js"; -import { type SectionInput, sectionGrant } from "../../../../src/sections/contract/module.js"; +import { executePlan } from "../../../src/engine/execute.js"; +import { validateSectionShapes } from "../../../src/engine/validate.js"; +import type { GitHubClient } from "../../../src/github/api.js"; +import { describeProblem } from "../../../src/problem.js"; +import type { SectionFailure } from "../../../src/sections/contract/errors.js"; +import { type SectionInput, sectionGrant } from "../../../src/sections/contract/module.js"; import { type OnMissingPermission, planContext, snapshotContext, -} from "../../../../src/sections/contract/plan.js"; -import { FEATURE_TOGGLES, repositorySection } from "../../../../src/sections/repository/index.js"; +} from "../../../src/sections/contract/plan.js"; +import { FEATURE_TOGGLES, repositorySection } from "../../../src/sections/repository/index.js"; import { normalizeTopics, PATCH_FIELDS, RepositoryConfig, -} from "../../../../src/sections/repository/schema.js"; -import { MockApi } from "../../../mock-api.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { deniedDetail, REPO, SectionFailed, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +} from "../../../src/sections/repository/schema.js"; +import { MockApi } from "../../mock-api.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { deniedDetail, REPO, SectionFailed, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; function shapeError(doc: Record, sourceLabel: string): string | null { return validateSectionShapes(doc, sourceLabel).match(() => null, describeProblem); diff --git a/test/src/sections/repository/scenarios/repository-apply-converges.yml b/test/sections/repository/scenarios/repository-apply-converges.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-apply-converges.yml rename to test/sections/repository/scenarios/repository-apply-converges.yml diff --git a/test/src/sections/repository/scenarios/repository-check-drift.yml b/test/sections/repository/scenarios/repository-check-drift.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-check-drift.yml rename to test/sections/repository/scenarios/repository-check-drift.yml diff --git a/test/src/sections/repository/scenarios/repository-get-only-key-rejected.yml b/test/sections/repository/scenarios/repository-get-only-key-rejected.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-get-only-key-rejected.yml rename to test/sections/repository/scenarios/repository-get-only-key-rejected.yml diff --git a/test/src/sections/repository/scenarios/repository-immutable-releases-check-drift.yml b/test/sections/repository/scenarios/repository-immutable-releases-check-drift.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-immutable-releases-check-drift.yml rename to test/sections/repository/scenarios/repository-immutable-releases-check-drift.yml diff --git a/test/src/sections/repository/scenarios/repository-immutable-releases-disable.yml b/test/sections/repository/scenarios/repository-immutable-releases-disable.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-immutable-releases-disable.yml rename to test/sections/repository/scenarios/repository-immutable-releases-disable.yml diff --git a/test/src/sections/repository/scenarios/repository-immutable-releases-enable.yml b/test/sections/repository/scenarios/repository-immutable-releases-enable.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-immutable-releases-enable.yml rename to test/sections/repository/scenarios/repository-immutable-releases-enable.yml diff --git a/test/src/sections/repository/scenarios/repository-lfs-check-note.yml b/test/sections/repository/scenarios/repository-lfs-check-note.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-lfs-check-note.yml rename to test/sections/repository/scenarios/repository-lfs-check-note.yml diff --git a/test/src/sections/repository/scenarios/repository-lfs-disable-apply.yml b/test/sections/repository/scenarios/repository-lfs-disable-apply.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-lfs-disable-apply.yml rename to test/sections/repository/scenarios/repository-lfs-disable-apply.yml diff --git a/test/src/sections/repository/scenarios/repository-lfs-enable-apply.yml b/test/sections/repository/scenarios/repository-lfs-enable-apply.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-lfs-enable-apply.yml rename to test/sections/repository/scenarios/repository-lfs-enable-apply.yml diff --git a/test/src/sections/repository/scenarios/repository-null-toggle-rejected.yml b/test/sections/repository/scenarios/repository-null-toggle-rejected.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-null-toggle-rejected.yml rename to test/sections/repository/scenarios/repository-null-toggle-rejected.yml diff --git a/test/src/sections/repository/scenarios/repository-pvr-disable.yml b/test/sections/repository/scenarios/repository-pvr-disable.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-pvr-disable.yml rename to test/sections/repository/scenarios/repository-pvr-disable.yml diff --git a/test/src/sections/repository/scenarios/repository-pvr-not-applicable.yml b/test/sections/repository/scenarios/repository-pvr-not-applicable.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-pvr-not-applicable.yml rename to test/sections/repository/scenarios/repository-pvr-not-applicable.yml diff --git a/test/src/sections/repository/scenarios/repository-rest-only-no-graphql.yml b/test/sections/repository/scenarios/repository-rest-only-no-graphql.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-rest-only-no-graphql.yml rename to test/sections/repository/scenarios/repository-rest-only-no-graphql.yml diff --git a/test/src/sections/repository/scenarios/repository-security-toggles-disable.yml b/test/sections/repository/scenarios/repository-security-toggles-disable.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-security-toggles-disable.yml rename to test/sections/repository/scenarios/repository-security-toggles-disable.yml diff --git a/test/src/sections/repository/scenarios/repository-security-toggles-enable.yml b/test/sections/repository/scenarios/repository-security-toggles-enable.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-security-toggles-enable.yml rename to test/sections/repository/scenarios/repository-security-toggles-enable.yml diff --git a/test/src/sections/repository/scenarios/repository-snapshot-roundtrip.yml b/test/sections/repository/scenarios/repository-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-snapshot-roundtrip.yml rename to test/sections/repository/scenarios/repository-snapshot-roundtrip.yml diff --git a/test/src/sections/repository/scenarios/repository-toggles-apply-converges.yml b/test/sections/repository/scenarios/repository-toggles-apply-converges.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-toggles-apply-converges.yml rename to test/sections/repository/scenarios/repository-toggles-apply-converges.yml diff --git a/test/src/sections/repository/scenarios/repository-toggles-check-drift.yml b/test/sections/repository/scenarios/repository-toggles-check-drift.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-toggles-check-drift.yml rename to test/sections/repository/scenarios/repository-toggles-check-drift.yml diff --git a/test/src/sections/repository/scenarios/repository-toggles-graphql-denied.yml b/test/sections/repository/scenarios/repository-toggles-graphql-denied.yml similarity index 100% rename from test/src/sections/repository/scenarios/repository-toggles-graphql-denied.yml rename to test/sections/repository/scenarios/repository-toggles-graphql-denied.yml diff --git a/test/src/sections/rulesets/generators.ts b/test/sections/rulesets/generators.ts similarity index 94% rename from test/src/sections/rulesets/generators.ts rename to test/sections/rulesets/generators.ts index 979b1b48..ed548a62 100644 --- a/test/src/sections/rulesets/generators.ts +++ b/test/sections/rulesets/generators.ts @@ -2,8 +2,8 @@ * The rulesets fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import { type EntriesForm, maybeWrapUndeclared } from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +import { type EntriesForm, maybeWrapUndeclared } from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; /** * The five parameters the spec requires of a pull_request rule, so a drawn rule parses and passes the mock's diff --git a/test/src/sections/rulesets/mock.test.ts b/test/sections/rulesets/mock.test.ts similarity index 92% rename from test/src/sections/rulesets/mock.test.ts rename to test/sections/rulesets/mock.test.ts index 5d939ff5..6be05425 100644 --- a/test/src/sections/rulesets/mock.test.ts +++ b/test/sections/rulesets/mock.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect, test } from "bun:test"; -import { handlerTestContext } from "../../../e2e/mock/handler-test-ctx.js"; -import { buildStateForSlug } from "../../../e2e/mock/state.js"; +import { handlerTestContext } from "../../e2e/mock/handler-test-ctx.js"; +import { buildStateForSlug } from "../../e2e/mock/state.js"; import { rulesetsMockHandlers } from "./mock.js"; describe("rulesets bypass_actors visibility", () => { diff --git a/test/src/sections/rulesets/mock.ts b/test/sections/rulesets/mock.ts similarity index 96% rename from test/src/sections/rulesets/mock.ts rename to test/sections/rulesets/mock.ts index cfa27158..0bb68ba4 100644 --- a/test/src/sections/rulesets/mock.ts +++ b/test/sections/rulesets/mock.ts @@ -2,7 +2,7 @@ * The rulesets e2e mock fragment (aggregated in test/e2e/mock/sections.ts). */ -import type { ListMockSpec } from "../../../e2e/mock/list-fragment.js"; +import type { ListMockSpec } from "../../e2e/mock/list-fragment.js"; import { asObject, invalidRuleTypeResponse, @@ -11,7 +11,7 @@ import { ok, type SectionRestHandlers, slicePage, -} from "../../../e2e/mock/support.js"; +} from "../../e2e/mock/support.js"; /** * The seed completion buildState applies (test/e2e/mock/state.ts LIST_MOCKS), and the create handler below spreads diff --git a/test/src/sections/rulesets/rulesets.test.ts b/test/sections/rulesets/rulesets.test.ts similarity index 97% rename from test/src/sections/rulesets/rulesets.test.ts rename to test/sections/rulesets/rulesets.test.ts index e3954353..9058cb51 100644 --- a/test/src/sections/rulesets/rulesets.test.ts +++ b/test/sections/rulesets/rulesets.test.ts @@ -1,17 +1,17 @@ import { describe, expect, test } from "bun:test"; -import { executePlan } from "../../../../src/engine/execute.js"; -import type { GitHubClient } from "../../../../src/github/api.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { planContext, snapshotContext } from "../../../../src/sections/contract/plan.js"; +import { executePlan } from "../../../src/engine/execute.js"; +import type { GitHubClient } from "../../../src/github/api.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { planContext, snapshotContext } from "../../../src/sections/contract/plan.js"; import { normalizeRefName, normalizeRuleset, rulesetsSection, -} from "../../../../src/sections/rulesets/index.js"; -import type { RulesetConfig } from "../../../../src/sections/rulesets/schema.js"; -import { MockApi } from "../../../mock-api.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +} from "../../../src/sections/rulesets/index.js"; +import type { RulesetConfig } from "../../../src/sections/rulesets/schema.js"; +import { MockApi } from "../../mock-api.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; describe("normalizeRefName", () => { test.each([ diff --git a/test/src/sections/rulesets/scenarios/rulesets-apply-bypass-hidden.yml b/test/sections/rulesets/scenarios/rulesets-apply-bypass-hidden.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-apply-bypass-hidden.yml rename to test/sections/rulesets/scenarios/rulesets-apply-bypass-hidden.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-apply-converges.yml b/test/sections/rulesets/scenarios/rulesets-apply-converges.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-apply-converges.yml rename to test/sections/rulesets/scenarios/rulesets-apply-converges.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-apply-empty-bypass-actors-converges.yml b/test/sections/rulesets/scenarios/rulesets-apply-empty-bypass-actors-converges.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-apply-empty-bypass-actors-converges.yml rename to test/sections/rulesets/scenarios/rulesets-apply-empty-bypass-actors-converges.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-apply-omitted-bypass-actors-refused.yml b/test/sections/rulesets/scenarios/rulesets-apply-omitted-bypass-actors-refused.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-apply-omitted-bypass-actors-refused.yml rename to test/sections/rulesets/scenarios/rulesets-apply-omitted-bypass-actors-refused.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-apply-parse-defaults-converge.yml b/test/sections/rulesets/scenarios/rulesets-apply-parse-defaults-converge.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-apply-parse-defaults-converge.yml rename to test/sections/rulesets/scenarios/rulesets-apply-parse-defaults-converge.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-check-bypass-hidden.yml b/test/sections/rulesets/scenarios/rulesets-check-bypass-hidden.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-check-bypass-hidden.yml rename to test/sections/rulesets/scenarios/rulesets-check-bypass-hidden.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-check-bypass-mode-change.yml b/test/sections/rulesets/scenarios/rulesets-check-bypass-mode-change.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-check-bypass-mode-change.yml rename to test/sections/rulesets/scenarios/rulesets-check-bypass-mode-change.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-check-drift.yml b/test/sections/rulesets/scenarios/rulesets-check-drift.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-check-drift.yml rename to test/sections/rulesets/scenarios/rulesets-check-drift.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-check-omitted-live-drift.yml b/test/sections/rulesets/scenarios/rulesets-check-omitted-live-drift.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-check-omitted-live-drift.yml rename to test/sections/rulesets/scenarios/rulesets-check-omitted-live-drift.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-invalid-rule-type.yml b/test/sections/rulesets/scenarios/rulesets-invalid-rule-type.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-invalid-rule-type.yml rename to test/sections/rulesets/scenarios/rulesets-invalid-rule-type.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-known-rule-parameters-rejected.yml b/test/sections/rulesets/scenarios/rulesets-known-rule-parameters-rejected.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-known-rule-parameters-rejected.yml rename to test/sections/rulesets/scenarios/rulesets-known-rule-parameters-rejected.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-known-wrong-values-rejected.yml b/test/sections/rulesets/scenarios/rulesets-known-wrong-values-rejected.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-known-wrong-values-rejected.yml rename to test/sections/rulesets/scenarios/rulesets-known-wrong-values-rejected.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-ref-pattern-rejected.yml b/test/sections/rulesets/scenarios/rulesets-ref-pattern-rejected.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-ref-pattern-rejected.yml rename to test/sections/rulesets/scenarios/rulesets-ref-pattern-rejected.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-snapshot-bypass-hidden.yml b/test/sections/rulesets/scenarios/rulesets-snapshot-bypass-hidden.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-snapshot-bypass-hidden.yml rename to test/sections/rulesets/scenarios/rulesets-snapshot-bypass-hidden.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-snapshot-roundtrip.yml b/test/sections/rulesets/scenarios/rulesets-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-snapshot-roundtrip.yml rename to test/sections/rulesets/scenarios/rulesets-snapshot-roundtrip.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-undeclared-delete.yml b/test/sections/rulesets/scenarios/rulesets-undeclared-delete.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-undeclared-delete.yml rename to test/sections/rulesets/scenarios/rulesets-undeclared-delete.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-undeclared-keep-note.yml b/test/sections/rulesets/scenarios/rulesets-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-undeclared-keep-note.yml rename to test/sections/rulesets/scenarios/rulesets-undeclared-keep-note.yml diff --git a/test/src/sections/rulesets/scenarios/rulesets-update-converges.yml b/test/sections/rulesets/scenarios/rulesets-update-converges.yml similarity index 100% rename from test/src/sections/rulesets/scenarios/rulesets-update-converges.yml rename to test/sections/rulesets/scenarios/rulesets-update-converges.yml diff --git a/test/sections/rulesets-schema.test.ts b/test/sections/rulesets/schema.test.ts similarity index 98% rename from test/sections/rulesets-schema.test.ts rename to test/sections/rulesets/schema.test.ts index e987b6c4..99b5fdad 100644 --- a/test/sections/rulesets-schema.test.ts +++ b/test/sections/rulesets/schema.test.ts @@ -7,10 +7,10 @@ */ import { describe, expect, test } from "bun:test"; -import { validateSectionShapes } from "../../src/engine/validate.js"; -import { KNOWN_RULE_TYPES } from "../../src/sections/rulesets/schema.js"; -import { RULESET_RULE_TYPES } from "../e2e/mock/support.js"; -import { PULL_REQUEST_PARAMETERS } from "../src/sections/rulesets/generators.js"; +import { validateSectionShapes } from "../../../src/engine/validate.js"; +import { KNOWN_RULE_TYPES } from "../../../src/sections/rulesets/schema.js"; +import { RULESET_RULE_TYPES } from "../../e2e/mock/support.js"; +import { PULL_REQUEST_PARAMETERS } from "./generators.js"; type Verdict = { ok: true; parsed: unknown } | { issues: readonly string[] }; diff --git a/test/sections/scenario-set.test.ts b/test/sections/scenario-set.test.ts index 327b25d8..f4034085 100644 --- a/test/sections/scenario-set.test.ts +++ b/test/sections/scenario-set.test.ts @@ -80,7 +80,7 @@ describe("the standard scenario set", () => { test.each(SECTIONS.map((section) => [section.key, section] as const))( "%s ships every scenario its contract implies, and its convergence proof declares the re-run", (key, section) => { - const dir = join(ROOT, "test", "src", "sections", key, "scenarios"); + const dir = join(ROOT, "test", "sections", key, "scenarios"); expect(missingScenarios(section, dir), `missing under ${dir}`).toEqual([]); expect(convergenceDefects(section, dir)).toEqual([]); }, diff --git a/test/src/sections/secret_scanning_custom_patterns/compilable-form.test.ts b/test/sections/secret_scanning_custom_patterns/compilable-form.test.ts similarity index 99% rename from test/src/sections/secret_scanning_custom_patterns/compilable-form.test.ts rename to test/sections/secret_scanning_custom_patterns/compilable-form.test.ts index c8366b4e..91d602bb 100644 --- a/test/src/sections/secret_scanning_custom_patterns/compilable-form.test.ts +++ b/test/sections/secret_scanning_custom_patterns/compilable-form.test.ts @@ -9,7 +9,7 @@ import { describe, expect, test } from "bun:test"; import { compilableForm, compileFailure, -} from "../../../../src/sections/secret_scanning_custom_patterns/compilable-form.js"; +} from "../../../src/sections/secret_scanning_custom_patterns/compilable-form.js"; function compiles(source: string): boolean { try { diff --git a/test/src/sections/secret_scanning_custom_patterns/generators.ts b/test/sections/secret_scanning_custom_patterns/generators.ts similarity index 88% rename from test/src/sections/secret_scanning_custom_patterns/generators.ts rename to test/sections/secret_scanning_custom_patterns/generators.ts index a21eb479..315d0aa4 100644 --- a/test/src/sections/secret_scanning_custom_patterns/generators.ts +++ b/test/sections/secret_scanning_custom_patterns/generators.ts @@ -2,14 +2,14 @@ * The secret_scanning_custom_patterns fuzz generator fragment. */ -import { SecretScanningPatternConfig } from "../../../../src/sections/secret_scanning_custom_patterns/schema.js"; +import { SecretScanningPatternConfig } from "../../../src/sections/secret_scanning_custom_patterns/schema.js"; import { type EntriesForm, generatorFromSlice, type Json, maybeWrapUndeclared, -} from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +} from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; const NAMES = ["internal-api-token", "staging-key", "vendor-secret", "license-key"] as const; // Every pool value passes the syntax check (generatorFromSlice validates each draw against the slice), and diff --git a/test/src/sections/secret_scanning_custom_patterns/mock.ts b/test/sections/secret_scanning_custom_patterns/mock.ts similarity index 99% rename from test/src/sections/secret_scanning_custom_patterns/mock.ts rename to test/sections/secret_scanning_custom_patterns/mock.ts index 8eb78136..356082ce 100644 --- a/test/src/sections/secret_scanning_custom_patterns/mock.ts +++ b/test/sections/secret_scanning_custom_patterns/mock.ts @@ -19,7 +19,7 @@ import { type SectionRestHandlers, secretScanningPatternFromCreate, slicePage, -} from "../../../e2e/mock/support.js"; +} from "../../e2e/mock/support.js"; export const secretScanningCustomPatternsMockHandlers: SectionRestHandlers<"secret_scanning_custom_patterns"> = { diff --git a/test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-apply-converges.yml b/test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-apply-converges.yml similarity index 100% rename from test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-apply-converges.yml rename to test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-apply-converges.yml diff --git a/test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-check-drift.yml b/test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-check-drift.yml similarity index 100% rename from test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-check-drift.yml rename to test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-check-drift.yml diff --git a/test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-snapshot-roundtrip.yml b/test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-snapshot-roundtrip.yml rename to test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-snapshot-roundtrip.yml diff --git a/test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-undeclared-delete.yml b/test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-undeclared-delete.yml similarity index 100% rename from test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-undeclared-delete.yml rename to test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-undeclared-delete.yml diff --git a/test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-undeclared-keep-note.yml b/test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-undeclared-keep-note.yml rename to test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-custom-patterns-undeclared-keep-note.yml diff --git a/test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-bootstrap-fail.yml b/test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-bootstrap-fail.yml similarity index 100% rename from test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-bootstrap-fail.yml rename to test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-bootstrap-fail.yml diff --git a/test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-bootstrap-warn.yml b/test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-bootstrap-warn.yml similarity index 100% rename from test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-bootstrap-warn.yml rename to test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-bootstrap-warn.yml diff --git a/test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-read-denied.yml b/test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-read-denied.yml similarity index 100% rename from test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-read-denied.yml rename to test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-read-denied.yml diff --git a/test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-rename.yml b/test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-rename.yml similarity index 100% rename from test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-rename.yml rename to test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-rename.yml diff --git a/test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-snapshot-hyperscan-forms.yml b/test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-snapshot-hyperscan-forms.yml similarity index 100% rename from test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-snapshot-hyperscan-forms.yml rename to test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-snapshot-hyperscan-forms.yml diff --git a/test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-uncompilable-regex-rejected.yml b/test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-uncompilable-regex-rejected.yml similarity index 100% rename from test/src/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-uncompilable-regex-rejected.yml rename to test/sections/secret_scanning_custom_patterns/scenarios/secret-scanning-patterns-uncompilable-regex-rejected.yml diff --git a/test/sections/secret-scanning-custom-patterns-schema.test.ts b/test/sections/secret_scanning_custom_patterns/schema.test.ts similarity index 97% rename from test/sections/secret-scanning-custom-patterns-schema.test.ts rename to test/sections/secret_scanning_custom_patterns/schema.test.ts index 90d19e3a..3760d0a6 100644 --- a/test/sections/secret-scanning-custom-patterns-schema.test.ts +++ b/test/sections/secret_scanning_custom_patterns/schema.test.ts @@ -5,7 +5,7 @@ */ import { describe, expect, test } from "bun:test"; -import { validateSectionShapes } from "../../src/engine/validate.js"; +import { validateSectionShapes } from "../../../src/engine/validate.js"; const KEY = "secret_scanning_custom_patterns"; const REFUSAL = "cannot be compiled as a regular expression"; diff --git a/test/src/sections/secret_scanning_custom_patterns/secret_scanning_custom_patterns.test.ts b/test/sections/secret_scanning_custom_patterns/secret_scanning_custom_patterns.test.ts similarity index 94% rename from test/src/sections/secret_scanning_custom_patterns/secret_scanning_custom_patterns.test.ts rename to test/sections/secret_scanning_custom_patterns/secret_scanning_custom_patterns.test.ts index 0663287f..9248e7b0 100644 --- a/test/src/sections/secret_scanning_custom_patterns/secret_scanning_custom_patterns.test.ts +++ b/test/sections/secret_scanning_custom_patterns/secret_scanning_custom_patterns.test.ts @@ -1,23 +1,23 @@ import { describe, expect, test } from "bun:test"; -import { validateSettingsDoc } from "../../../../src/engine/orchestrate.js"; -import { SectionSelection } from "../../../../src/engine/section-selection.js"; -import { snapshotRepository } from "../../../../src/engine/snapshot.js"; -import { silentIo } from "../../../../src/io.js"; -import { describeProblem } from "../../../../src/problem.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; +import { validateSettingsDoc } from "../../../src/engine/orchestrate.js"; +import { SectionSelection } from "../../../src/engine/section-selection.js"; +import { snapshotRepository } from "../../../src/engine/snapshot.js"; +import { silentIo } from "../../../src/io.js"; +import { describeProblem } from "../../../src/problem.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; import { type PlainData, planContext, type SectionPlan, -} from "../../../../src/sections/contract/plan.js"; -import { secretScanningPatternsSection } from "../../../../src/sections/secret_scanning_custom_patterns/index.js"; -import type { SecretScanningPatternConfig } from "../../../../src/sections/secret_scanning_custom_patterns/schema.js"; -import { captureIo } from "../../../io/capture.js"; -import { MockApi } from "../../../mock-api.js"; -import { fragmentFake } from "../../../sections/fragment-fake.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +} from "../../../src/sections/contract/plan.js"; +import { secretScanningPatternsSection } from "../../../src/sections/secret_scanning_custom_patterns/index.js"; +import type { SecretScanningPatternConfig } from "../../../src/sections/secret_scanning_custom_patterns/schema.js"; +import { captureIo } from "../../io/capture.js"; +import { MockApi } from "../../mock-api.js"; +import { fragmentFake } from "../fragment-fake.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; import { secretScanningCustomPatternsMockHandlers } from "./mock.js"; /** The bare-array list body the mock serves for a live pattern set. */ diff --git a/test/src/sections/teams/generators.ts b/test/sections/teams/generators.ts similarity index 69% rename from test/src/sections/teams/generators.ts rename to test/sections/teams/generators.ts index 65ff7b58..e2fc3418 100644 --- a/test/src/sections/teams/generators.ts +++ b/test/sections/teams/generators.ts @@ -2,9 +2,9 @@ * The teams fuzz generator fragment. */ -import { TeamConfig } from "../../../../src/sections/teams/schema.js"; -import { generatorFromSlice, type Json, uniqueBy } from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +import { TeamConfig } from "../../../src/sections/teams/schema.js"; +import { generatorFromSlice, type Json, uniqueBy } from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; const genTeam = generatorFromSlice(TeamConfig, { fields: { diff --git a/test/src/sections/teams/mock.test.ts b/test/sections/teams/mock.test.ts similarity index 85% rename from test/src/sections/teams/mock.test.ts rename to test/sections/teams/mock.test.ts index f6e074a8..2f174d62 100644 --- a/test/src/sections/teams/mock.test.ts +++ b/test/sections/teams/mock.test.ts @@ -4,13 +4,13 @@ */ import { describe, expect, test } from "bun:test"; -import { planContext, snapshotContext } from "../../../../src/sections/contract/plan.js"; -import { teamsSection } from "../../../../src/sections/teams/index.js"; -import { handlerTestContext } from "../../../e2e/mock/handler-test-ctx.js"; -import { buildStateForSlug } from "../../../e2e/mock/state.js"; -import { fragmentFake } from "../../../sections/fragment-fake.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import { planContext, snapshotContext } from "../../../src/sections/contract/plan.js"; +import { teamsSection } from "../../../src/sections/teams/index.js"; +import { handlerTestContext } from "../../e2e/mock/handler-test-ctx.js"; +import { buildStateForSlug } from "../../e2e/mock/state.js"; +import { fragmentFake } from "../fragment-fake.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; import { TEAM_REPOSITORY_MEDIA_TYPE, teamsMockHandlers } from "./mock.js"; const LIVE = { teams: { platform: { role_name: "write" } } }; diff --git a/test/src/sections/teams/mock.ts b/test/sections/teams/mock.ts similarity index 95% rename from test/src/sections/teams/mock.ts rename to test/sections/teams/mock.ts index 24aa9a36..04aa2bb8 100644 --- a/test/src/sections/teams/mock.ts +++ b/test/sections/teams/mock.ts @@ -2,13 +2,13 @@ * The teams e2e mock fragment (aggregated in test/e2e/mock/sections.ts). */ -import { permissionForRole } from "../../../../src/sections/shared/roles.js"; +import { permissionForRole } from "../../../src/sections/shared/roles.js"; import { GRANT_PERMISSIONS, grantablePermission, restRepoSurface, teamRepoFromPut, -} from "../../../e2e/mock/state.js"; +} from "../../e2e/mock/state.js"; import { asObject, type Json, @@ -18,7 +18,7 @@ import { PERMISSION_NOT_GRANTABLE, type SectionRestHandlers, slicePage, -} from "../../../e2e/mock/support.js"; +} from "../../e2e/mock/support.js"; /** The Accept media type the probe's role_name body is served under; the section sends it (probeTeamRole, index.ts). */ export const TEAM_REPOSITORY_MEDIA_TYPE = "application/vnd.github.v3.repository+json"; diff --git a/test/src/sections/teams/scenarios/teams-apply-converges.yml b/test/sections/teams/scenarios/teams-apply-converges.yml similarity index 100% rename from test/src/sections/teams/scenarios/teams-apply-converges.yml rename to test/sections/teams/scenarios/teams-apply-converges.yml diff --git a/test/src/sections/teams/scenarios/teams-apply-mixed-case-slug.yml b/test/sections/teams/scenarios/teams-apply-mixed-case-slug.yml similarity index 100% rename from test/src/sections/teams/scenarios/teams-apply-mixed-case-slug.yml rename to test/sections/teams/scenarios/teams-apply-mixed-case-slug.yml diff --git a/test/src/sections/teams/scenarios/teams-apply-permission-change.yml b/test/sections/teams/scenarios/teams-apply-permission-change.yml similarity index 100% rename from test/src/sections/teams/scenarios/teams-apply-permission-change.yml rename to test/sections/teams/scenarios/teams-apply-permission-change.yml diff --git a/test/src/sections/teams/scenarios/teams-check-clean.yml b/test/sections/teams/scenarios/teams-check-clean.yml similarity index 100% rename from test/src/sections/teams/scenarios/teams-check-clean.yml rename to test/sections/teams/scenarios/teams-check-clean.yml diff --git a/test/src/sections/teams/scenarios/teams-check-drift.yml b/test/sections/teams/scenarios/teams-check-drift.yml similarity index 100% rename from test/src/sections/teams/scenarios/teams-check-drift.yml rename to test/sections/teams/scenarios/teams-check-drift.yml diff --git a/test/src/sections/teams/scenarios/teams-name-not-a-slug-rejected.yml b/test/sections/teams/scenarios/teams-name-not-a-slug-rejected.yml similarity index 100% rename from test/src/sections/teams/scenarios/teams-name-not-a-slug-rejected.yml rename to test/sections/teams/scenarios/teams-name-not-a-slug-rejected.yml diff --git a/test/src/sections/teams/scenarios/teams-snapshot-roundtrip.yml b/test/sections/teams/scenarios/teams-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/teams/scenarios/teams-snapshot-roundtrip.yml rename to test/sections/teams/scenarios/teams-snapshot-roundtrip.yml diff --git a/test/src/sections/teams/scenarios/teams-undeclared-delete.yml b/test/sections/teams/scenarios/teams-undeclared-delete.yml similarity index 100% rename from test/src/sections/teams/scenarios/teams-undeclared-delete.yml rename to test/sections/teams/scenarios/teams-undeclared-delete.yml diff --git a/test/src/sections/teams/scenarios/teams-undeclared-keep-note.yml b/test/sections/teams/scenarios/teams-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/teams/scenarios/teams-undeclared-keep-note.yml rename to test/sections/teams/scenarios/teams-undeclared-keep-note.yml diff --git a/test/src/sections/teams/scenarios/teams-user-account-skip.yml b/test/sections/teams/scenarios/teams-user-account-skip.yml similarity index 100% rename from test/src/sections/teams/scenarios/teams-user-account-skip.yml rename to test/sections/teams/scenarios/teams-user-account-skip.yml diff --git a/test/sections/teams-schema.test.ts b/test/sections/teams/schema.test.ts similarity index 97% rename from test/sections/teams-schema.test.ts rename to test/sections/teams/schema.test.ts index cf10f6a6..abc2fab2 100644 --- a/test/sections/teams-schema.test.ts +++ b/test/sections/teams/schema.test.ts @@ -5,7 +5,7 @@ */ import { describe, expect, test } from "bun:test"; -import { validateSectionShapes } from "../../src/engine/validate.js"; +import { validateSectionShapes } from "../../../src/engine/validate.js"; function verdict(name: unknown): { ok: true } | { issues: readonly string[] } { return validateSectionShapes({ teams: [{ name, permission: "push" }] }, "settings.yml").match( diff --git a/test/src/sections/teams/teams.test.ts b/test/sections/teams/teams.test.ts similarity index 94% rename from test/src/sections/teams/teams.test.ts rename to test/sections/teams/teams.test.ts index 07c26f3f..624776e1 100644 --- a/test/src/sections/teams/teams.test.ts +++ b/test/sections/teams/teams.test.ts @@ -1,13 +1,13 @@ import { describe, expect, test } from "bun:test"; -import type { SectionInput, SectionModule } from "../../../../src/sections/contract/module.js"; -import { planContext, snapshotContext } from "../../../../src/sections/contract/plan.js"; -import { sectionModule } from "../../../../src/sections/registry.js"; -import { teamsSection } from "../../../../src/sections/teams/index.js"; -import { MockApi } from "../../../mock-api.js"; -import { fragmentFake } from "../../../sections/fragment-fake.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import type { SectionInput, SectionModule } from "../../../src/sections/contract/module.js"; +import { planContext, snapshotContext } from "../../../src/sections/contract/plan.js"; +import { sectionModule } from "../../../src/sections/registry.js"; +import { teamsSection } from "../../../src/sections/teams/index.js"; +import { MockApi } from "../../mock-api.js"; +import { fragmentFake } from "../fragment-fake.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; import { teamsMockHandlers } from "./mock.js"; /** The registered module: the owner gate the registry composes is part of the behavior under test. */ diff --git a/test/src/sections/webhooks/generators.ts b/test/sections/webhooks/generators.ts similarity index 89% rename from test/src/sections/webhooks/generators.ts rename to test/sections/webhooks/generators.ts index b84f10ad..590d1808 100644 --- a/test/src/sections/webhooks/generators.ts +++ b/test/sections/webhooks/generators.ts @@ -2,14 +2,14 @@ * The webhooks fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import { REPOSITORY_WEBHOOK_EVENTS } from "../../../../src/sections/webhooks/events.js"; +import { REPOSITORY_WEBHOOK_EVENTS } from "../../../src/sections/webhooks/events.js"; import { E2E_SECRET_ENV, type EntriesForm, type Json, maybeWrapUndeclared, -} from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +} from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; const E2E_SECRET_REFS = Object.keys(E2E_SECRET_ENV).map((name) => `$${name}`); diff --git a/test/src/sections/webhooks/mock.ts b/test/sections/webhooks/mock.ts similarity index 94% rename from test/src/sections/webhooks/mock.ts rename to test/sections/webhooks/mock.ts index 2d30a45d..bfdabf03 100644 --- a/test/src/sections/webhooks/mock.ts +++ b/test/sections/webhooks/mock.ts @@ -4,8 +4,8 @@ * config.secret on any read or write echo -> "********" */ -import type { ListMockSpec } from "../../../e2e/mock/list-fragment.js"; -import { completeHook } from "../../../e2e/mock/state.js"; +import type { ListMockSpec } from "../../e2e/mock/list-fragment.js"; +import { completeHook } from "../../e2e/mock/state.js"; import { asObject, maskedConfig, @@ -15,7 +15,7 @@ import { type SectionRestHandlers, slicePage, storedHookConfig, -} from "../../../e2e/mock/support.js"; +} from "../../e2e/mock/support.js"; /** * The seed completion buildState applies (test/e2e/mock/state.ts LIST_MOCKS). A hook's server diff --git a/test/src/sections/webhooks/scenarios/webhooks-apply-converges.yml b/test/sections/webhooks/scenarios/webhooks-apply-converges.yml similarity index 100% rename from test/src/sections/webhooks/scenarios/webhooks-apply-converges.yml rename to test/sections/webhooks/scenarios/webhooks-apply-converges.yml diff --git a/test/src/sections/webhooks/scenarios/webhooks-check-drift.yml b/test/sections/webhooks/scenarios/webhooks-check-drift.yml similarity index 100% rename from test/src/sections/webhooks/scenarios/webhooks-check-drift.yml rename to test/sections/webhooks/scenarios/webhooks-check-drift.yml diff --git a/test/src/sections/webhooks/scenarios/webhooks-known-wrong-values-rejected.yml b/test/sections/webhooks/scenarios/webhooks-known-wrong-values-rejected.yml similarity index 100% rename from test/src/sections/webhooks/scenarios/webhooks-known-wrong-values-rejected.yml rename to test/sections/webhooks/scenarios/webhooks-known-wrong-values-rejected.yml diff --git a/test/src/sections/webhooks/scenarios/webhooks-secret-leaks-nowhere.yml b/test/sections/webhooks/scenarios/webhooks-secret-leaks-nowhere.yml similarity index 100% rename from test/src/sections/webhooks/scenarios/webhooks-secret-leaks-nowhere.yml rename to test/sections/webhooks/scenarios/webhooks-secret-leaks-nowhere.yml diff --git a/test/src/sections/webhooks/scenarios/webhooks-snapshot-roundtrip.yml b/test/sections/webhooks/scenarios/webhooks-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/webhooks/scenarios/webhooks-snapshot-roundtrip.yml rename to test/sections/webhooks/scenarios/webhooks-snapshot-roundtrip.yml diff --git a/test/src/sections/webhooks/scenarios/webhooks-undeclared-delete.yml b/test/sections/webhooks/scenarios/webhooks-undeclared-delete.yml similarity index 100% rename from test/src/sections/webhooks/scenarios/webhooks-undeclared-delete.yml rename to test/sections/webhooks/scenarios/webhooks-undeclared-delete.yml diff --git a/test/src/sections/webhooks/scenarios/webhooks-undeclared-keep-note.yml b/test/sections/webhooks/scenarios/webhooks-undeclared-keep-note.yml similarity index 100% rename from test/src/sections/webhooks/scenarios/webhooks-undeclared-keep-note.yml rename to test/sections/webhooks/scenarios/webhooks-undeclared-keep-note.yml diff --git a/test/src/sections/webhooks/scenarios/webhooks-unset-secret-fails.yml b/test/sections/webhooks/scenarios/webhooks-unset-secret-fails.yml similarity index 100% rename from test/src/sections/webhooks/scenarios/webhooks-unset-secret-fails.yml rename to test/sections/webhooks/scenarios/webhooks-unset-secret-fails.yml diff --git a/test/sections/webhooks-schema.test.ts b/test/sections/webhooks/schema.test.ts similarity index 97% rename from test/sections/webhooks-schema.test.ts rename to test/sections/webhooks/schema.test.ts index 39c7b26d..482407ed 100644 --- a/test/sections/webhooks-schema.test.ts +++ b/test/sections/webhooks/schema.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "bun:test"; import { ok } from "neverthrow"; -import { validateSectionShapes } from "../../src/engine/validate.js"; -import { WEBHOOK_EVENTS_REFERENCE } from "../../src/sections/webhooks/events.js"; +import { validateSectionShapes } from "../../../src/engine/validate.js"; +import { WEBHOOK_EVENTS_REFERENCE } from "../../../src/sections/webhooks/events.js"; /** The issue lines the run prints before exiting 1, or null when the document parses. */ function problems(webhooks: unknown): string[] | null { diff --git a/test/src/sections/webhooks/webhooks.test.ts b/test/sections/webhooks/webhooks.test.ts similarity index 95% rename from test/src/sections/webhooks/webhooks.test.ts rename to test/sections/webhooks/webhooks.test.ts index 71a74eb8..61a58df9 100644 --- a/test/src/sections/webhooks/webhooks.test.ts +++ b/test/sections/webhooks/webhooks.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "bun:test"; -import { validateSectionShapes } from "../../../../src/engine/validate.js"; -import { describeProblem } from "../../../../src/problem.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; +import { validateSectionShapes } from "../../../src/engine/validate.js"; +import { describeProblem } from "../../../src/problem.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; import { driftOf, type ExecTools, @@ -9,14 +9,14 @@ import { planContext, planDrift, type SectionPlan, -} from "../../../../src/sections/contract/plan.js"; -import { webhooksSection } from "../../../../src/sections/webhooks/index.js"; -import type { WebhookConfig } from "../../../../src/sections/webhooks/schema.js"; -import { MockApi } from "../../../mock-api.js"; -import { fragmentFake } from "../../../sections/fragment-fake.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +} from "../../../src/sections/contract/plan.js"; +import { webhooksSection } from "../../../src/sections/webhooks/index.js"; +import type { WebhookConfig } from "../../../src/sections/webhooks/schema.js"; +import { MockApi } from "../../mock-api.js"; +import { fragmentFake } from "../fragment-fake.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; import { webhooksMockHandlers } from "./mock.js"; function shapeError(doc: Record, sourceLabel: string): string | null { diff --git a/test/src/sections/workflows/generators.ts b/test/sections/workflows/generators.ts similarity index 76% rename from test/src/sections/workflows/generators.ts rename to test/sections/workflows/generators.ts index c3a9c8ff..adaf52df 100644 --- a/test/src/sections/workflows/generators.ts +++ b/test/sections/workflows/generators.ts @@ -2,8 +2,8 @@ * The workflows fuzz generator fragment, aggregated by test/e2e/generators.ts. */ -import type { Json } from "../../../e2e/gen-support.js"; -import type { Rng } from "../../../e2e/prng.js"; +import type { Json } from "../../e2e/gen-support.js"; +import type { Rng } from "../../e2e/prng.js"; export function genWorkflows(rng: Rng): Json[] { return Array.from({ length: rng.int(2) + 1 }, (_, i) => ({ diff --git a/test/src/sections/workflows/mock.ts b/test/sections/workflows/mock.ts similarity index 96% rename from test/src/sections/workflows/mock.ts rename to test/sections/workflows/mock.ts index 1cab5825..e4901a53 100644 --- a/test/src/sections/workflows/mock.ts +++ b/test/sections/workflows/mock.ts @@ -2,7 +2,7 @@ * The workflows e2e mock fragment (registered in test/e2e/mock/sections.ts). */ -import { noContent, ok, type SectionRestHandlers, slicePage } from "../../../e2e/mock/support.js"; +import { noContent, ok, type SectionRestHandlers, slicePage } from "../../e2e/mock/support.js"; export const workflowsMockHandlers: SectionRestHandlers<"workflows"> = { "workflows.list": ({ state, query }) => { diff --git a/test/src/sections/workflows/scenarios/workflows-apply-converges.yml b/test/sections/workflows/scenarios/workflows-apply-converges.yml similarity index 100% rename from test/src/sections/workflows/scenarios/workflows-apply-converges.yml rename to test/sections/workflows/scenarios/workflows-apply-converges.yml diff --git a/test/src/sections/workflows/scenarios/workflows-check-drift.yml b/test/sections/workflows/scenarios/workflows-check-drift.yml similarity index 100% rename from test/src/sections/workflows/scenarios/workflows-check-drift.yml rename to test/sections/workflows/scenarios/workflows-check-drift.yml diff --git a/test/src/sections/workflows/scenarios/workflows-snapshot-roundtrip.yml b/test/sections/workflows/scenarios/workflows-snapshot-roundtrip.yml similarity index 100% rename from test/src/sections/workflows/scenarios/workflows-snapshot-roundtrip.yml rename to test/sections/workflows/scenarios/workflows-snapshot-roundtrip.yml diff --git a/test/src/sections/workflows/workflows.test.ts b/test/sections/workflows/workflows.test.ts similarity index 91% rename from test/src/sections/workflows/workflows.test.ts rename to test/sections/workflows/workflows.test.ts index 53eb4bec..c66b9b29 100644 --- a/test/src/sections/workflows/workflows.test.ts +++ b/test/sections/workflows/workflows.test.ts @@ -1,12 +1,12 @@ import { describe, expect, test } from "bun:test"; -import type { GitHubClient } from "../../../../src/github/api.js"; -import type { SectionInput } from "../../../../src/sections/contract/module.js"; -import { planContext } from "../../../../src/sections/contract/plan.js"; -import { workflowsSection } from "../../../../src/sections/workflows/index.js"; -import { MockApi } from "../../../mock-api.js"; -import { provePlanIdempotent } from "../../../sections/plan-idempotence.js"; -import { REPO, unwrap } from "../../../sections/section-run.js"; -import { validatedInput } from "../../../sections/validated-input.js"; +import type { GitHubClient } from "../../../src/github/api.js"; +import type { SectionInput } from "../../../src/sections/contract/module.js"; +import { planContext } from "../../../src/sections/contract/plan.js"; +import { workflowsSection } from "../../../src/sections/workflows/index.js"; +import { MockApi } from "../../mock-api.js"; +import { provePlanIdempotent } from "../plan-idempotence.js"; +import { REPO, unwrap } from "../section-run.js"; +import { validatedInput } from "../validated-input.js"; /** A live workflow as the list endpoint returns it. */ interface LiveWorkflow {