[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71G0KGGZW1742P7X11EPY79":3,"skill-same:01M71G0KGGZW1742P7X11EPY79":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":26,"linkOnly":27,"markdownContent":28,"markdownBody":29,"frontMatter":30,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":14,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M71G0KGGZW1742P7X11EPY79","python-test-standards",null,"Python test standards enforced across all skills. Loaded by other skills, not invoked directly.","outcomeeng\u002Fplugins","outcomeeng","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F257335685?v=4","01M71FRVRF36XYR3HRSCGFHK2R","Outcome Engineering","01M71FRVS4BZG17DWANFJ7EPNY",1,"MIT","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Fpython\u002Fskills\u002Fpython-test-standards\u002FSKILL.md",[],[19,20,21,22,23,24,25],"standards","test","python test standards","python","false","read","across","2026-11-10 10:12:30",false,"---\nname: python-test-standards\nuser-invocable: false\ndescription: >-\n  Python test standards enforced across all skills. Loaded by other skills, not invoked directly.\nallowed-tools: Read\n---\n\n\u003Cobjective>\nThe Python-specific test standards every Python skill enforces.\n\u003C\u002Fobjective>\n\n\u003Crepo_local_overlay>\nWhen another skill loads this reference inside a repository, it must also check for `spx\u002Flocal\u002Fpython-tests.md` at the repository root. Read that file after this reference if it exists and apply it as repo-local routing to the product's governing specs and decisions. A local overlay supplements skill behavior; it does not declare product truth.\n\u003C\u002Frepo_local_overlay>\n\n\u003Ccore_model>\nEvery Python test file name encodes three independent axes:\n\n| Axis     | Tokens                                                         | Meaning                                    |\n| -------- | -------------------------------------------------------------- | ------------------------------------------ |\n| Evidence | `scenario`, `mapping`, `conformance`, `property`, `compliance` | What kind of evidence the test provides    |\n| Level    | `l1`, `l2`, `l3`                                               | How painful the test is to run             |\n| Runner   | optional token such as `playwright`                            | Which non-default runner executes the file |\n\nCanonical filename:\n\n```text\ntest_\u003Csubject>.\u003Cevidence>.\u003Clevel>[.\u003Crunner>].py\n```\n\nDo not use `.unit.py`, `.integration.py`, `.e2e.py`, or `.spec.py` as the signal for evidence, level, or runner.\n\u003C\u002Fcore_model>\n\n\u003Cexecution_levels>\nChoose the level from execution pain and dependency availability:\n\n| Level | Infrastructure                                    | Default runner | Typical runtime |\n| ----- | ------------------------------------------------- | -------------- | --------------- |\n| `l1`  | Python stdlib, temp dirs, repository dev tools    | pytest         | milliseconds    |\n| `l2`  | Docker, browsers, dev servers, product binaries   | pytest         | seconds         |\n| `l3`  | Remote services, credentials, shared environments | pytest         | seconds\u002Fminutes |\n\nUse a runner token when a non-default runner owns execution. Browser execution can be `l2` or `l3`; the runner does not decide the level.\n\u003C\u002Fexecution_levels>\n\n\u003Csource_first_testability>\nThe first move when testing existing Python code is to improve the code under test until it has a source contract that can be tested cleanly.\n\nMUST refactor source before writing or accepting a weak test when the only available test path requires copied source literals, arbitrary example bags, `Mock`\u002F`MagicMock` replacement, `mocker.patch`, monkeypatching the behavior under test, `sys.path` tricks, or fixture-file laundering.\n\nSource modules own domain protocol values through enums, schemas, dataclasses, registries, constructors, typed factories, or public constants that are meaningful to production consumers. Tests import those source-owned contracts.\n\nScripts and command entrypoints stay thin. Tests verify argument parsing and dispatch at the boundary while deeper behavior is tested through imported modules.\n\u003C\u002Fsource_first_testability>\n\n\u003Ctest_data_policy>\nEvery test case — input and expected output — derives from a source independent of the test author's invention. The legitimate sources:\n\n| Assertion type | Case source                                                                                                                                                            |\n| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Scenario       | The spec assertion text — the case is declared by the spec, not invented by the test author                                                                            |\n| Mapping        | A finite source-owned enumeration (enum, registry, schema, structured metadata)                                                                                        |\n| Property       | A generator over a domain — the author writes the invariant, the generator owns the cases                                                                              |\n| Conformance    | An external oracle (schema validator, reference implementation, parser the test doesn't author)                                                                        |\n| Compliance     | The decision record being enforced — the case is the rule itself                                                                                                       |\n| Any (fixture)  | An inert fixture file under `product_testing\u002Ffixtures\u002F`, passed to the code under test as a file path or byte stream — the file's whole real-world payload is the case |\n\nThe first five rows pair an assertion type with the case source it normally takes. The Fixture row is cross-cutting: any assertion type may use an inert fixture file as the case when the assertion is about the code's behavior on a whole real-world payload that the test author did not invent.\n\nA case the author hand-picked because it \"looked reasonable\" is a tautology dressed as a measurement. The author wrote or read the implementation, so the invention encodes the same model the code embodies, and every future run confirms that shared model rather than the spec. The defect is in the case's *origin*; lexical location (`Final` at module scope, plain assignment, inline literal), syntactic form, and reuse pattern (shared bag, single-value, parametrize row) are irrelevant.\n\nWhere the *values* the cases use live:\n\n| Value kind                                                   | Lives in                                                                      |\n| ------------------------------------------------------------ | ----------------------------------------------------------------------------- |\n| Production vocabulary (labels, paths, schema fields, tokens) | The owning production module, imported                                        |\n| Variable input domain                                        | A generator under `product_testing\u002Fgenerators\u002F`                               |\n| Resource-bound or runner-tuning value (timeouts, retries)    | The harness module that owns the resource, under `product_testing\u002Fharnesses\u002F` |\n| Whole-payload real-world sample                              | An inert fixture file under `product_testing\u002Ffixtures\u002F`, read by path         |\n| One-off descriptive text (test titles, diagnostic messages)  | Inline in the test function body                                              |\n\nExecuted Python test files are typed assertion files. Their test functions or callbacks own every predicate and assertion API call. Bindings may receive or rename actual results, imported source contracts, generated values, harness observations, callback inputs, resource handles, or fixture paths when they introduce no data or policy. They never choose literals, numbers, vocabulary, case data, expected results, configuration, setup policy, generator domains, or verdict rules.\n\n**Container keys are vocabulary.** In dict literals, JSON-encoded strings, set or tuple members, and f-string templates, the *keys* and *members* are vocabulary — a hand-written key is a hand-picked case for the parser or consumer. Construct containers via `{LABEL: synthetic_value, ...}` with `LABEL` imported from the owning production module, then serialize with `json.dumps` if a string is needed.\n\n**Artifacts are downstream of Python.** A YAML, HCL, bash, JSON schema, or IaC template file is not a legitimate source-of-truth. A Python module either renders the artifact or consumes it; that module owns the artifact's vocabulary. A test that hand-copies an artifact field name has invented the case — the production-owning module is the source, even if it has to be created first.\n\n**Missing source-of-truth modules.** When no Python module owns a needed value today, the missing module is the architectural defect, not the test. Create the source-of-truth module first; the test imports from it.\n\nAllowed source-owned value:\n\n```python\nfrom product.audit import VERDICT_STATUSES\n```\n\nRejected local stand-in:\n\n```python\nVERDICT_STATUSES = (\"fail\", \"skipped\", \"pass\")\n```\n\nAllowed harness-owned tuning:\n\n```python\nfrom product_testing.harnesses.subprocess import DEFAULT_TIMEOUT_MS\n```\n\nRejected tuning at test scope (the subprocess harness owns the resource and the timeout):\n\n```python\nTIMEOUT_SECONDS = 10\n```\n\nRejected JSON template with hand-written keys (`verdict-status` is invented vocabulary):\n\n```python\npayload = f'{{\"verdict-status\": \"{status}\"}}'\n```\n\nAllowed JSON construction with imported keys:\n\n```python\nfrom product.audit import VERDICT_STATUS_FIELD\n\nassert parse_payload(json.dumps({VERDICT_STATUS_FIELD: status})).status == status\n```\n\n\u003C\u002Ftest_data_policy>\n\n\u003Cgenerators>\nUse generators for input domains that vary per run or across generated cases. Generators MUST vary, compose, shrink, or explore more than one meaningful value.\n\nUse Hypothesis strategies for property evidence:\n\n```python\nfrom hypothesis import strategies as st\n\n\ndef valid_gate_names() -> st.SearchStrategy[str]:\n    return st.text(min_size=1).filter(str.isidentifier)\n```\n\nUse source-owned registries inside generators only when the generated domain is meaningfully variable:\n\n```python\nfrom hypothesis import strategies as st\n\nfrom product.audit import VERDICT_STATUSES\n\n\ndef verdict_statuses() -> st.SearchStrategy[str]:\n    return st.sampled_from(VERDICT_STATUSES)\n```\n\nNEVER wrap a source-owned singleton with `st.just(...)`, singleton `st.sampled_from(...)`, or a constant-returning function and call it a generator. Import the source-owned singleton directly.\n\u003C\u002Fgenerators>\n\n\u003Charnesses>\nUse harnesses for tests that interact with filesystems, subprocesses, APIs, Docker, Playwright, databases, local services, or pytest discovery entrypoints. A harness manages setup, teardown, cleanup, dependency checks, and access to behavior.\n\nPython harnesses live under `product_testing\u002Fharnesses\u002F`:\n\n```python\nfrom collections.abc import Iterator\nfrom contextlib import contextmanager\nfrom pathlib import Path\nfrom tempfile import TemporaryDirectory\n\n\n@contextmanager\ndef with_test_env(config: Config) -> Iterator[ProductTreeEnv]:\n    with TemporaryDirectory() as tmp:\n        env = ProductTreeEnv(root=Path(tmp), config=config)\n        env.initialize()\n        yield env\n```\n\nPytest fixture callables that perform setup, teardown, cleanup, or dependency access are harness entrypoints. Place their body code under `product_testing\u002Fharnesses\u002F`; import them explicitly from `conftest.py` only for pytest discovery.\n\n```python\n# conftest.py\nfrom product_testing.harnesses.database import database_session\nfrom product_testing.harnesses.filesystem import temp_product\n```\n\n`conftest.py` may register pytest markers, hooks, and explicit fixture imports. It MUST NOT contain fixture body code, harness classes, generated data, source vocabulary, or hidden setup policy.\n\u003C\u002Fharnesses>\n\n\u003Cfixtures>\nFixture files are inert data payloads. Use them for real-world inputs the code under test would encounter, such as captured JSONL, saved API responses, markdown documents, malformed source files, binary samples, or parser corpora.\n\nExecuted tests access fixture files only by path, by reading files, or by copying files into temp products. Executed tests never import fixture files as modules and never consume fixture exports.\n\nStrings and numbers are never valid fixture files by themselves. A string literal representing a domain value belongs in the production module or a variable generator.\n\u003C\u002Ffixtures>\n\n\u003Cdependency_injection>\nTests verify behavior through real code paths. Avoid framework-level replacement of the dependency under test.\n\nForbidden replacement patterns:\n\n- `unittest.mock.patch` replacing the module that should provide evidence\n- `Mock()` or `MagicMock()` replacing behavior that the test claims to verify\n- `mocker.patch(...)` replacing the dependency under test\n- `monkeypatch` replacing the behavior under test\n\nAllowed controlled implementations and recording collaborators are explicit objects or classes passed through dependency injection and mapped to a `\u002Ftest` Stage 5 exception. They implement the production Protocol, preserve the behavior boundary, and expose state or recorded interactions only. The linked test asserts against those observations. They NEVER accept an expected outcome, call `assert`, expose `was_called_with` or `assert_called`, or return pass\u002Ffail verdicts.\n\u003C\u002Fdependency_injection>\n\n\u003Cpredicate_and_oracle_litmus>\n\nApply every question in `\u002Ftest-evidence-standards` `\u003Ccommon_litmus_questions>`, every per-assertion-type source-and-oracle rule in its `\u003Cassertion_type_litmus>`, every mutation in its `\u003Cmutation_litmus>`, and every field of its `\u003Cassertion_design_record>`. That shared set is the complete list; the items below render the ones whose form is Python-specific and never replace or bound it.\n\n- Invert the `assert` expression. Only the linked test changes; no harness or collaborator code changes.\n- Read the test function alone. Every pass\u002Ffail predicate is visible there.\n- Trace each case to the spec scenario, complete source-owned mapping, Hypothesis domain, external conformance oracle, governing compliance rule, or inert whole-payload fixture.\n- Trace each expected result to an oracle outside the production table, algorithm, parser, branch logic, or collaborator verdict method under test.\n- Mutate the assertion-relevant production behavior. The test fails.\n- Read each fixture and harness. It returns observations, state, or handles — never a verdict, and never a `*_succeeds`, `is_valid`, `was_called_with`, or `assert_called` method.\n- Read a failure message. It reports actual against expected at the `assert` site, not `assert helper(...)`.\n- Ask whether the same fixture or harness could serve a test claiming the opposite about the same observation. It can when the predicate is test-owned.\n\n\u003C\u002Fpredicate_and_oracle_litmus>\n\n\u003Cproperty_based_testing>\nProperty assertions about parsers, serializers, mathematical operations, or invariant-preserving algorithms require Hypothesis and a meaningful property.\n\n| Code type               | Required property        | Pattern       |\n| ----------------------- | ------------------------ | ------------- |\n| Parsers                 | `parse(format(x)) == x`  | `@given(...)` |\n| Serialization           | `decode(encode(x)) == x` | `@given(...)` |\n| Mathematical operations | algebraic laws           | `@given(...)` |\n| Complex algorithms      | invariant preservation   | `@given(...)` |\n\n`@given` that only checks \"does not throw\" is insufficient. The property must fail when the requirement is broken.\n\nProperty tests MUST run through a harness or wrapper that owns the Hypothesis profile, seed policy, run count, deadline, and replay diagnostics. The test file supplies the invariant and imports generated domains; it does not declare `@settings(...)`, seeds, example databases, run counts, or retry policy. On failure, the harness output must include the seed or Hypothesis replay directive needed to reproduce the generated case.\n\u003C\u002Fproperty_based_testing>\n\n\u003Cboundary_validation>\nAn assertion that a field, parser, or constructor rejects values outside a predicate routes by the shape of the invalid set, not by a hand-picked bag of bad inputs.\n\n- Open or infinite invalid space — arbitrary strings, identifiers, timestamps, keys, generated names — is a `property` claim. The evidence is a Hypothesis strategy generating values outside the valid predicate (for example `st.text().filter(lambda s: not s.isidentifier())`), asserting rejection across the generated domain.\n- Closed, source-owned invalid set — enum variants, a defined protocol set, registry members — is a `mapping` claim. The evidence parameterizes over every source-owned invalid member, imported from the owning module, never hand-copied.\n\nA `property`-floor rejection rule is not satisfied by a finite parametrize over a hand-picked subset of an open space. Mode selection is `\u002Ftest`'s authority (see the boundary-validation router in `\u002Ftest`'s methodology); this standard teaches only the Python expression of that router's output.\n\u003C\u002Fboundary_validation>\n\n\u003Canti_patterns>\nReject or rewrite these patterns:\n\n- Legacy file suffixes: `.unit.py`, `.integration.py`, `.e2e.py`, `.spec.py`\n- Runner-level collapse: assuming Playwright means `l3`\n- Level-evidence collapse: assuming `scenario` means high-cost execution\n- Framework mocks replacing the dependency under test\n- Property claims implemented only with examples\n- Hand-picked test cases — the author chose the input because it \"seemed reasonable to exercise the code\"; every future run confirms the author's understanding rather than the spec assertion\n- `INVALID_*_INPUTS` \u002F `INVALID_*_CASES` tuples, or any module- or class-scope bag of invalid values — a hand-picked set standing in for the invalid domain. Remedy by domain: an open or infinite invalid space (arbitrary strings, identifiers, timestamps, keys, generated names) takes a Hypothesis strategy generating values *outside* the valid predicate; a closed, source-owned invalid set (enum variants, a defined protocol set, registry members) imports the source enum or registry rather than hand-copying members\n- Source-owned values copied into local constants\n- Test-file-local constants for values the production module owns\n- Variable or constant declarations in executed test files that introduce data, expected outputs, runner settings, setup policy, literals, numbers, vocabulary, case choices, or configuration rather than aliasing a value derived solely from an imported owner\n- Pytest fixture parameters or property-generated parameters that choose data, configuration, setup policy, or verdict rules; parameters that only receive values from their semantic owner remain assertion flow\n- Hand-written keys in container literals (dict keys, JSON object keys, set or tuple members, f-string templates) — keys are vocabulary, and a hand-written key is an invented case for the parser or consumer\n- Hand-copied artifact field names from YAML, HCL, bash, JSON schema, or IaC templates as substitutes for imports from the Python module that should render or consume the artifact\n- Test-runner tuning values (timeouts, retries, polling intervals) declared at test scope when the harness that owns the resource should own the value\n- Hypothesis settings, seeds, run counts, deadlines, or replay policy declared in a test file instead of the property-test harness\n- Production modules created only to aggregate values for tests\n- Co-located test-infrastructure modules under `tests\u002F`, `tests\u002Fhelpers\u002F`, `tests\u002Fsupport\u002F`, or node-local support modules\n- Fixture body code in `conftest.py`\n- Pytest fixture body code under `product_testing\u002Ffixtures\u002F`\n- Importing inert fixture files as Python modules\n- Silent skips for required credentialed evidence\n\nDo not require `spx validation literal` for Python tests. The literal validator is TypeScript-only. Enforce source-owned values through review and Python test standards.\n\u003C\u002Fanti_patterns>\n\n\u003Csuccess_criteria>\nPython test guidance follows this standard when:\n\n- `\u002Ftest` determines the assertion type, execution level, and exception path before implementation\n- Test filenames use `test_\u003Csubject>.\u003Cevidence>.\u003Clevel>[.\u003Crunner>].py`\n- Executed test functions and callbacks own every predicate and assertion API call; infrastructure exposes observations without verdict logic\n- Test-file bindings introduce no local data or policy; aliases, fixture parameters, and property-generated parameters are valid when they only receive values selected by their semantic owner\n- Every case and expected result passes the assertion-type provenance and oracle-independence litmus\n- Source architecture is improved before tests accept copied values, replacement mocks, or fixture laundering\n- Every test case has a documentable source outside the author's head — spec assertion text, source-owned enumeration, generator over a domain, external oracle, decision record, or inert fixture file\n- Source-owned values come from the owning production module; container keys are imported, not hand-written; runner-tuning values live on the harness that owns the resource\n- Generators vary, compose, shrink, or explore meaningful alternatives\n- Property tests route through a harness or wrapper that reports the seed or replay directive on failure\n- Harnesses live under `product_testing\u002Fharnesses\u002F` and manage resource lifecycles\n- Inert fixture files live under `product_testing\u002Ffixtures\u002F` and are consumed only as files\n- `conftest.py` is limited to pytest discovery, registration, and explicit imports from canonical harness modules\n- Property assertions use meaningful Hypothesis properties\n- Required credentialed evidence fails loudly when selected credentials are absent\n\n\u003C\u002Fsuccess_criteria>\n","\u003Cobjective>\nThe Python-specific test standards every Python skill enforces.\n\u003C\u002Fobjective>\n\n\u003Crepo_local_overlay>\nWhen another skill loads this reference inside a repository, it must also check for `spx\u002Flocal\u002Fpython-tests.md` at the repository root. Read that file after this reference if it exists and apply it as repo-local routing to the product's governing specs and decisions. A local overlay supplements skill behavior; it does not declare product truth.\n\u003C\u002Frepo_local_overlay>\n\n\u003Ccore_model>\nEvery Python test file name encodes three independent axes:\n\n| Axis     | Tokens                                                         | Meaning                                    |\n| -------- | -------------------------------------------------------------- | ------------------------------------------ |\n| Evidence | `scenario`, `mapping`, `conformance`, `property`, `compliance` | What kind of evidence the test provides    |\n| Level    | `l1`, `l2`, `l3`                                               | How painful the test is to run             |\n| Runner   | optional token such as `playwright`                            | Which non-default runner executes the file |\n\nCanonical filename:\n\n```text\ntest_\u003Csubject>.\u003Cevidence>.\u003Clevel>[.\u003Crunner>].py\n```\n\nDo not use `.unit.py`, `.integration.py`, `.e2e.py`, or `.spec.py` as the signal for evidence, level, or runner.\n\u003C\u002Fcore_model>\n\n\u003Cexecution_levels>\nChoose the level from execution pain and dependency availability:\n\n| Level | Infrastructure                                    | Default runner | Typical runtime |\n| ----- | ------------------------------------------------- | -------------- | --------------- |\n| `l1`  | Python stdlib, temp dirs, repository dev tools    | pytest         | milliseconds    |\n| `l2`  | Docker, browsers, dev servers, product binaries   | pytest         | seconds         |\n| `l3`  | Remote services, credentials, shared environments | pytest         | seconds\u002Fminutes |\n\nUse a runner token when a non-default runner owns execution. Browser execution can be `l2` or `l3`; the runner does not decide the level.\n\u003C\u002Fexecution_levels>\n\n\u003Csource_first_testability>\nThe first move when testing existing Python code is to improve the code under test until it has a source contract that can be tested cleanly.\n\nMUST refactor source before writing or accepting a weak test when the only available test path requires copied source literals, arbitrary example bags, `Mock`\u002F`MagicMock` replacement, `mocker.patch`, monkeypatching the behavior under test, `sys.path` tricks, or fixture-file laundering.\n\nSource modules own domain protocol values through enums, schemas, dataclasses, registries, constructors, typed factories, or public constants that are meaningful to production consumers. Tests import those source-owned contracts.\n\nScripts and command entrypoints stay thin. Tests verify argument parsing and dispatch at the boundary while deeper behavior is tested through imported modules.\n\u003C\u002Fsource_first_testability>\n\n\u003Ctest_data_policy>\nEvery test case — input and expected output — derives from a source independent of the test author's invention. The legitimate sources:\n\n| Assertion type | Case source                                                                                                                                                            |\n| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Scenario       | The spec assertion text — the case is declared by the spec, not invented by the test author                                                                            |\n| Mapping        | A finite source-owned enumeration (enum, registry, schema, structured metadata)                                                                                        |\n| Property       | A generator over a domain — the author writes the invariant, the generator owns the cases                                                                              |\n| Conformance    | An external oracle (schema validator, reference implementation, parser the test doesn't author)                                                                        |\n| Compliance     | The decision record being enforced — the case is the rule itself                                                                                                       |\n| Any (fixture)  | An inert fixture file under `product_testing\u002Ffixtures\u002F`, passed to the code under test as a file path or byte stream — the file's whole real-world payload is the case |\n\nThe first five rows pair an assertion type with the case source it normally takes. The Fixture row is cross-cutting: any assertion type may use an inert fixture file as the case when the assertion is about the code's behavior on a whole real-world payload that the test author did not invent.\n\nA case the author hand-picked because it \"looked reasonable\" is a tautology dressed as a measurement. The author wrote or read the implementation, so the invention encodes the same model the code embodies, and every future run confirms that shared model rather than the spec. The defect is in the case's *origin*; lexical location (`Final` at module scope, plain assignment, inline literal), syntactic form, and reuse pattern (shared bag, single-value, parametrize row) are irrelevant.\n\nWhere the *values* the cases use live:\n\n| Value kind                                                   | Lives in                                                                      |\n| ------------------------------------------------------------ | ----------------------------------------------------------------------------- |\n| Production vocabulary (labels, paths, schema fields, tokens) | The owning production module, imported                                        |\n| Variable input domain                                        | A generator under `product_testing\u002Fgenerators\u002F`                               |\n| Resource-bound or runner-tuning value (timeouts, retries)    | The harness module that owns the resource, under `product_testing\u002Fharnesses\u002F` |\n| Whole-payload real-world sample                              | An inert fixture file under `product_testing\u002Ffixtures\u002F`, read by path         |\n| One-off descriptive text (test titles, diagnostic messages)  | Inline in the test function body                                              |\n\nExecuted Python test files are typed assertion files. Their test functions or callbacks own every predicate and assertion API call. Bindings may receive or rename actual results, imported source contracts, generated values, harness observations, callback inputs, resource handles, or fixture paths when they introduce no data or policy. They never choose literals, numbers, vocabulary, case data, expected results, configuration, setup policy, generator domains, or verdict rules.\n\n**Container keys are vocabulary.** In dict literals, JSON-encoded strings, set or tuple members, and f-string templates, the *keys* and *members* are vocabulary — a hand-written key is a hand-picked case for the parser or consumer. Construct containers via `{LABEL: synthetic_value, ...}` with `LABEL` imported from the owning production module, then serialize with `json.dumps` if a string is needed.\n\n**Artifacts are downstream of Python.** A YAML, HCL, bash, JSON schema, or IaC template file is not a legitimate source-of-truth. A Python module either renders the artifact or consumes it; that module owns the artifact's vocabulary. A test that hand-copies an artifact field name has invented the case — the production-owning module is the source, even if it has to be created first.\n\n**Missing source-of-truth modules.** When no Python module owns a needed value today, the missing module is the architectural defect, not the test. Create the source-of-truth module first; the test imports from it.\n\nAllowed source-owned value:\n\n```python\nfrom product.audit import VERDICT_STATUSES\n```\n\nRejected local stand-in:\n\n```python\nVERDICT_STATUSES = (\"fail\", \"skipped\", \"pass\")\n```\n\nAllowed harness-owned tuning:\n\n```python\nfrom product_testing.harnesses.subprocess import DEFAULT_TIMEOUT_MS\n```\n\nRejected tuning at test scope (the subprocess harness owns the resource and the timeout):\n\n```python\nTIMEOUT_SECONDS = 10\n```\n\nRejected JSON template with hand-written keys (`verdict-status` is invented vocabulary):\n\n```python\npayload = f'{{\"verdict-status\": \"{status}\"}}'\n```\n\nAllowed JSON construction with imported keys:\n\n```python\nfrom product.audit import VERDICT_STATUS_FIELD\n\nassert parse_payload(json.dumps({VERDICT_STATUS_FIELD: status})).status == status\n```\n\n\u003C\u002Ftest_data_policy>\n\n\u003Cgenerators>\nUse generators for input domains that vary per run or across generated cases. Generators MUST vary, compose, shrink, or explore more than one meaningful value.\n\nUse Hypothesis strategies for property evidence:\n\n```python\nfrom hypothesis import strategies as st\n\n\ndef valid_gate_names() -> st.SearchStrategy[str]:\n    return st.text(min_size=1).filter(str.isidentifier)\n```\n\nUse source-owned registries inside generators only when the generated domain is meaningfully variable:\n\n```python\nfrom hypothesis import strategies as st\n\nfrom product.audit import VERDICT_STATUSES\n\n\ndef verdict_statuses() -> st.SearchStrategy[str]:\n    return st.sampled_from(VERDICT_STATUSES)\n```\n\nNEVER wrap a source-owned singleton with `st.just(...)`, singleton `st.sampled_from(...)`, or a constant-returning function and call it a generator. Import the source-owned singleton directly.\n\u003C\u002Fgenerators>\n\n\u003Charnesses>\nUse harnesses for tests that interact with filesystems, subprocesses, APIs, Docker, Playwright, databases, local services, or pytest discovery entrypoints. A harness manages setup, teardown, cleanup, dependency checks, and access to behavior.\n\nPython harnesses live under `product_testing\u002Fharnesses\u002F`:\n\n```python\nfrom collections.abc import Iterator\nfrom contextlib import contextmanager\nfrom pathlib import Path\nfrom tempfile import TemporaryDirectory\n\n\n@contextmanager\ndef with_test_env(config: Config) -> Iterator[ProductTreeEnv]:\n    with TemporaryDirectory() as tmp:\n        env = ProductTreeEnv(root=Path(tmp), config=config)\n        env.initialize()\n        yield env\n```\n\nPytest fixture callables that perform setup, teardown, cleanup, or dependency access are harness entrypoints. Place their body code under `product_testing\u002Fharnesses\u002F`; import them explicitly from `conftest.py` only for pytest discovery.\n\n```python\n# conftest.py\nfrom product_testing.harnesses.database import database_session\nfrom product_testing.harnesses.filesystem import temp_product\n```\n\n`conftest.py` may register pytest markers, hooks, and explicit fixture imports. It MUST NOT contain fixture body code, harness classes, generated data, source vocabulary, or hidden setup policy.\n\u003C\u002Fharnesses>\n\n\u003Cfixtures>\nFixture files are inert data payloads. Use them for real-world inputs the code under test would encounter, such as captured JSONL, saved API responses, markdown documents, malformed source files, binary samples, or parser corpora.\n\nExecuted tests access fixture files only by path, by reading files, or by copying files into temp products. Executed tests never import fixture files as modules and never consume fixture exports.\n\nStrings and numbers are never valid fixture files by themselves. A string literal representing a domain value belongs in the production module or a variable generator.\n\u003C\u002Ffixtures>\n\n\u003Cdependency_injection>\nTests verify behavior through real code paths. Avoid framework-level replacement of the dependency under test.\n\nForbidden replacement patterns:\n\n- `unittest.mock.patch` replacing the module that should provide evidence\n- `Mock()` or `MagicMock()` replacing behavior that the test claims to verify\n- `mocker.patch(...)` replacing the dependency under test\n- `monkeypatch` replacing the behavior under test\n\nAllowed controlled implementations and recording collaborators are explicit objects or classes passed through dependency injection and mapped to a `\u002Ftest` Stage 5 exception. They implement the production Protocol, preserve the behavior boundary, and expose state or recorded interactions only. The linked test asserts against those observations. They NEVER accept an expected outcome, call `assert`, expose `was_called_with` or `assert_called`, or return pass\u002Ffail verdicts.\n\u003C\u002Fdependency_injection>\n\n\u003Cpredicate_and_oracle_litmus>\n\nApply every question in `\u002Ftest-evidence-standards` `\u003Ccommon_litmus_questions>`, every per-assertion-type source-and-oracle rule in its `\u003Cassertion_type_litmus>`, every mutation in its `\u003Cmutation_litmus>`, and every field of its `\u003Cassertion_design_record>`. That shared set is the complete list; the items below render the ones whose form is Python-specific and never replace or bound it.\n\n- Invert the `assert` expression. Only the linked test changes; no harness or collaborator code changes.\n- Read the test function alone. Every pass\u002Ffail predicate is visible there.\n- Trace each case to the spec scenario, complete source-owned mapping, Hypothesis domain, external conformance oracle, governing compliance rule, or inert whole-payload fixture.\n- Trace each expected result to an oracle outside the production table, algorithm, parser, branch logic, or collaborator verdict method under test.\n- Mutate the assertion-relevant production behavior. The test fails.\n- Read each fixture and harness. It returns observations, state, or handles — never a verdict, and never a `*_succeeds`, `is_valid`, `was_called_with`, or `assert_called` method.\n- Read a failure message. It reports actual against expected at the `assert` site, not `assert helper(...)`.\n- Ask whether the same fixture or harness could serve a test claiming the opposite about the same observation. It can when the predicate is test-owned.\n\n\u003C\u002Fpredicate_and_oracle_litmus>\n\n\u003Cproperty_based_testing>\nProperty assertions about parsers, serializers, mathematical operations, or invariant-preserving algorithms require Hypothesis and a meaningful property.\n\n| Code type               | Required property        | Pattern       |\n| ----------------------- | ------------------------ | ------------- |\n| Parsers                 | `parse(format(x)) == x`  | `@given(...)` |\n| Serialization           | `decode(encode(x)) == x` | `@given(...)` |\n| Mathematical operations | algebraic laws           | `@given(...)` |\n| Complex algorithms      | invariant preservation   | `@given(...)` |\n\n`@given` that only checks \"does not throw\" is insufficient. The property must fail when the requirement is broken.\n\nProperty tests MUST run through a harness or wrapper that owns the Hypothesis profile, seed policy, run count, deadline, and replay diagnostics. The test file supplies the invariant and imports generated domains; it does not declare `@settings(...)`, seeds, example databases, run counts, or retry policy. On failure, the harness output must include the seed or Hypothesis replay directive needed to reproduce the generated case.\n\u003C\u002Fproperty_based_testing>\n\n\u003Cboundary_validation>\nAn assertion that a field, parser, or constructor rejects values outside a predicate routes by the shape of the invalid set, not by a hand-picked bag of bad inputs.\n\n- Open or infinite invalid space — arbitrary strings, identifiers, timestamps, keys, generated names — is a `property` claim. The evidence is a Hypothesis strategy generating values outside the valid predicate (for example `st.text().filter(lambda s: not s.isidentifier())`), asserting rejection across the generated domain.\n- Closed, source-owned invalid set — enum variants, a defined protocol set, registry members — is a `mapping` claim. The evidence parameterizes over every source-owned invalid member, imported from the owning module, never hand-copied.\n\nA `property`-floor rejection rule is not satisfied by a finite parametrize over a hand-picked subset of an open space. Mode selection is `\u002Ftest`'s authority (see the boundary-validation router in `\u002Ftest`'s methodology); this standard teaches only the Python expression of that router's output.\n\u003C\u002Fboundary_validation>\n\n\u003Canti_patterns>\nReject or rewrite these patterns:\n\n- Legacy file suffixes: `.unit.py`, `.integration.py`, `.e2e.py`, `.spec.py`\n- Runner-level collapse: assuming Playwright means `l3`\n- Level-evidence collapse: assuming `scenario` means high-cost execution\n- Framework mocks replacing the dependency under test\n- Property claims implemented only with examples\n- Hand-picked test cases — the author chose the input because it \"seemed reasonable to exercise the code\"; every future run confirms the author's understanding rather than the spec assertion\n- `INVALID_*_INPUTS` \u002F `INVALID_*_CASES` tuples, or any module- or class-scope bag of invalid values — a hand-picked set standing in for the invalid domain. Remedy by domain: an open or infinite invalid space (arbitrary strings, identifiers, timestamps, keys, generated names) takes a Hypothesis strategy generating values *outside* the valid predicate; a closed, source-owned invalid set (enum variants, a defined protocol set, registry members) imports the source enum or registry rather than hand-copying members\n- Source-owned values copied into local constants\n- Test-file-local constants for values the production module owns\n- Variable or constant declarations in executed test files that introduce data, expected outputs, runner settings, setup policy, literals, numbers, vocabulary, case choices, or configuration rather than aliasing a value derived solely from an imported owner\n- Pytest fixture parameters or property-generated parameters that choose data, configuration, setup policy, or verdict rules; parameters that only receive values from their semantic owner remain assertion flow\n- Hand-written keys in container literals (dict keys, JSON object keys, set or tuple members, f-string templates) — keys are vocabulary, and a hand-written key is an invented case for the parser or consumer\n- Hand-copied artifact field names from YAML, HCL, bash, JSON schema, or IaC templates as substitutes for imports from the Python module that should render or consume the artifact\n- Test-runner tuning values (timeouts, retries, polling intervals) declared at test scope when the harness that owns the resource should own the value\n- Hypothesis settings, seeds, run counts, deadlines, or replay policy declared in a test file instead of the property-test harness\n- Production modules created only to aggregate values for tests\n- Co-located test-infrastructure modules under `tests\u002F`, `tests\u002Fhelpers\u002F`, `tests\u002Fsupport\u002F`, or node-local support modules\n- Fixture body code in `conftest.py`\n- Pytest fixture body code under `product_testing\u002Ffixtures\u002F`\n- Importing inert fixture files as Python modules\n- Silent skips for required credentialed evidence\n\nDo not require `spx validation literal` for Python tests. The literal validator is TypeScript-only. Enforce source-owned values through review and Python test standards.\n\u003C\u002Fanti_patterns>\n\n\u003Csuccess_criteria>\nPython test guidance follows this standard when:\n\n- `\u002Ftest` determines the assertion type, execution level, and exception path before implementation\n- Test filenames use `test_\u003Csubject>.\u003Cevidence>.\u003Clevel>[.\u003Crunner>].py`\n- Executed test functions and callbacks own every predicate and assertion API call; infrastructure exposes observations without verdict logic\n- Test-file bindings introduce no local data or policy; aliases, fixture parameters, and property-generated parameters are valid when they only receive values selected by their semantic owner\n- Every case and expected result passes the assertion-type provenance and oracle-independence litmus\n- Source architecture is improved before tests accept copied values, replacement mocks, or fixture laundering\n- Every test case has a documentable source outside the author's head — spec assertion text, source-owned enumeration, generator over a domain, external oracle, decision record, or inert fixture file\n- Source-owned values come from the owning production module; container keys are imported, not hand-written; runner-tuning values live on the harness that owns the resource\n- Generators vary, compose, shrink, or explore meaningful alternatives\n- Property tests route through a harness or wrapper that reports the seed or replay directive on failure\n- Harnesses live under `product_testing\u002Fharnesses\u002F` and manage resource lifecycles\n- Inert fixture files live under `product_testing\u002Ffixtures\u002F` and are consumed only as files\n- `conftest.py` is limited to pytest discovery, registration, and explicit imports from canonical harness modules\n- Property assertions use meaningful Hypothesis properties\n- Required credentialed evidence fails loudly when selected credentials are absent\n\n\u003C\u002Fsuccess_criteria>\n",{"name":5,"description":7,"allowed-tools":31,"user-invocable":27},"Read","main","978d51c51d68c99cffb2ba48f7cad9d2f07e5738","src\u002Fplugins\u002Fpython\u002Fskills\u002Fpython-test-standards","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins","https:\u002F\u002Fgithub.com\u002Foutcomeeng","https:\u002F\u002Foutcome.engineering","Spec-driven development for AI-assisted engineering","2026-11-14 20:33:56",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add outcomeeng\u002Fplugins --skill python-test-standards",{"tool":46,"command":47},"bunx","bunx skills add outcomeeng\u002Fplugins --skill python-test-standards",{"tool":49,"command":50},"pnpm","pnpm dlx skills add outcomeeng\u002Fplugins --skill python-test-standards","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Fpython\u002Fskills\u002Fpython-test-standards\u002FSKILL.md",true,[],[55,61,88,104,113,123],{"skillNo":56,"name":57,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":26},"01M71G25RZTPQG9KJ00JCHC1F7","plugin","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Ftemplates\u002Fplugin\u002FSKILL.md",[],[57],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":26},"01M71G23DCX3SV60H63HBBKQ6J","sanitize-powerpoint","ALWAYS invoke this skill when sanitizing, cleaning up, auditing, or aligning a PowerPoint (.pptx) deck — slide-master and layout structure, layout type attributes, stray fonts, non-theme colors, or layout naming. NEVER hand-edit pptx XML without this skill.","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Fwork\u002Fskills\u002Fsanitize-powerpoint\u002FSKILL.md",[],[68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87],"sanitize powerpoint","powerpoint","sanitize","fonts","type","cleaning","structure","never","attributes","theme","pptx","naming","layout","deck","up","edit","xml","master","invoke","when",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":26},"01M71G21PQKBCDECHGVYSKPJW5","draw-excalidraw","ALWAYS invoke this skill when creating Excalidraw diagrams, visualizing workflows, architectures, or concepts. NEVER generate Excalidraw JSON without this skill.","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Fwork\u002Fskills\u002Fdraw-excalidraw\u002FSKILL.md",[],[95,96,97,98,99,75,86,100,101,87,102,103],"draw excalidraw","excalidraw","draw","diagrams","architectures","generate","workflows","concepts","json",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":26},"01M71G1ZMNGFD37RZYM620XM2C","typescript-test-standards","TypeScript test standards enforced across all skills. Loaded by other skills, not invoked directly.","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-test-standards\u002FSKILL.md",[],[111,112,20,19,23,24,25],"typescript","typescript test standards",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":26},"01M71G1XBH0X1VCTR7269MDGSY","typescript-code-standards","TypeScript code standards enforced across all skills. Loaded by other skills, not invoked directly.","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-code-standards\u002FSKILL.md",[],[111,120,121,122,19,23,24,25],"code","typescript code standards","code standards",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":26},"01M71G1TQ3VN45SJ75DFMJDB9W","typescript-architecture-standards","TypeScript ADR conventions enforced across architect and auditor skills. Loaded by other skills, not invoked directly.","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-architecture-standards\u002FSKILL.md",[],[130,19,131,132,111,133,134,25,24,135,23,136],"architecture standards","typescript architecture standards","architecture","adr","architect","auditor","conventions"]