Skip to content

M2-13: Pass non-UI end-to-end integration gate #34

Closed

Description

@pillowtalk-Qy
Type: Milestone Integration Gate
Priority: P0
Initial status: Blocked
Owner: Independent QA
Depends on: M2-08, M2-12
Blocks: M3 final integration
Writable: tests/integration/**, request fixtures, docs/m2-gate-report.md

唯一目标

从 HTTP request 到合法 PreflightReport 跑通 happy、mismatch、Warning 和 failure,证明主链路没有 Clear402 依赖。

验收

[ ] happy fixture -> MANUAL_REVIEW
[ ] amount mismatch -> STOP
[ ] tokenOut mismatch -> STOP
[ ] RPC failure -> explicit failed evidence/STOP behavior
[ ] warning -> STOP
[ ] malformed request -> 4xx,无 Decision
[ ] invariant/programming error -> 5xx,无 fake STOP
[ ] health endpoint 成功
[ ] CLEAR402_ENABLED absent/false 仍完整通过
[ ] curl examples 可重复
[ ] gate report 含 exact SHA/test count

验证

pnpm test:integration
pnpm check
pnpm dev

另开 Terminal:

curl -fsS http://127.0.0.1:3000/api/health | jq
curl -sS -X POST http://127.0.0.1:3000/api/preflight -H 'content-type: application/json' --data @fixtures/requests/happy.json | jq '.report.decision'
curl -sS -X POST http://127.0.0.1:3000/api/preflight -H 'content-type: application/json' --data @fixtures/requests/amount-mismatch.json | jq '.report.decision'

Codex 指令

从 QA 视角只添加跨包 integration fixtures/tests 和 gate report。
不要在 Gate PR 顺手修业务;发现缺陷另开最小 Bug Issue。结论只允许 PASS/NO-GO。

5.3 M3:Mini-Demo Console and Gate A

Activity

  1. pillowtalk-Qy commented on Aug 8, 2026

    @pillowtalk-Qy
    ContributorAuthor

    DEPENDENCY_GATE_CLEARED

    Issue #34 directly depends on M2-08 (#29) and M2-12 (#33). Both are now Closed / Project Done and their protected squash commits are contained in current main@a09c2a7b989b67264e8078857127a5dd96df1643:

    Their upstream M2 alignment/report dependencies #30 and #31 are also Closed / Project Done and ancestors of current main. The non-UI integration-gate dependency is satisfied, so #34 may enter planning from this exact baseline.

    Ready/In Progress means planning authority only. It is not Scope Confirmed, test implementation authorization, SINGLE_OPERATOR_QA PASS, gate PASS, READY_TO_MERGE, or merge authorization. A closed path-specific QA Work Plan and separate Scope Gate remain mandatory before any branch, worktree, fixture, test, report, commit, push, or PR.

  2. self-assigned this
    on Aug 8, 2026
  3. pillowtalk-Qy commented on Aug 8, 2026

    @pillowtalk-Qy
    ContributorAuthor

    M2_GATE_SLOT_ASSIGNED

    Gate operator: pillowtalk-Qy

    Planning baseline: origin/main@a09c2a7b989b67264e8078857127a5dd96df1643

    Dependency gate: #34 (comment)

    Issue #34 is now the single active gate slot and moves to Project In Progress for planning.

    Planned branch after scope confirmation: codex/issue-34-non-ui-gate

    Planned isolated worktree after authorization: /Users/qy/Documents/moss-mini-demo-issue-34

    The first required artifact is a closed QA Work Plan defining the exact request fixtures, cross-package HTTP integration matrix, deterministic Fixture-mode expectations, malformed/invariant boundaries, health/dev curl reproduction, CLEAR402-disabled proof, gate-report contents, exact writable paths, and the rule that any discovered business defect becomes a separate Bug Issue rather than a gate-PR fix.

    In Progress starts planning only. It is not Scope Confirmed, implementation authorization, QA PASS, Gate PASS, READY_TO_MERGE, Merge Gate, or merge authorization. No branch, worktree, file change, commit, push, or PR may be created before the separate Scope Gate.

  4. pillowtalk-Qy commented on Aug 8, 2026

    @pillowtalk-Qy
    ContributorAuthor

    Final QA Work Plan - M2-13 non-UI end-to-end integration gate

    0. Planning control

    This is a planning artifact only. No branch, worktree, fixture, test, report, commit, push, PR, or gate verdict is authorized before a separate SCOPE_CONFIRMED / IMPLEMENTATION_AUTHORIZED record accepts this plan.

    1. Unique objective

    Exercise the shipped non-UI HTTP boundary from JSON Request to validated Response across happy, mismatch, warning, acquisition failure, malformed request, and programming/invariant failure. Prove health and Fixture-mode curl reproduction with Clear402 absent/false, and publish a PASS or NO-GO report. The gate PR adds no business behavior and performs no live RPC, wallet, signing, transaction, deployment, or Clear402 operation.

    2. Exact writable paths

    Exactly these ten paths are writable:

    1. package.json
    2. fixtures/requests/happy.json
    3. fixtures/requests/amount-mismatch.json
    4. fixtures/requests/token-out-mismatch.json
    5. fixtures/requests/rpc-failure.json
    6. fixtures/requests/warning.json
    7. fixtures/requests/malformed.json
    8. fixtures/requests/programming-error.json
    9. tests/integration/preflight-api.test.ts
    10. docs/m2-gate-report.md

    package.json is the sole explicit metadata correction beyond Issue #34's initial writable summary. The Issue requires pnpm test:integration, but that script does not exist on the authorized baseline. The only permitted root change is:

    test:integration = pnpm build && vitest run tests/integration

    This is necessary to make the required verification command real and clean-checkout complete. It does not alter check; root test already discovers integration tests. No lockfile, dependency, lifecycle permission, workflow, package, product source, existing schema, Fixture report, vendor, API route, deployment, governance, or protection change is authorized.

    3. Request fixtures

    Every request fixture is strict, minimal JSON and contains no credential-shaped key:

    • happy.json: FIXTURE / manual-review-success;
    • amount-mismatch.json: FIXTURE / amount-in-mismatch;
    • token-out-mismatch.json: FIXTURE / token-out-mismatch;
    • rpc-failure.json: LIVE request matching the existing offline FakeMoss environment; the test harness injects synthetic simulation acquisition failure;
    • warning.json: the same valid LIVE intent with the existing FakeMoss warning scenario;
    • malformed.json: a strict-contract-invalid request with no secret value;
    • programming-error.json: valid FIXTURE request passed to a test-local service that throws an invariant/programming sentinel.

    The three FIXTURE scenarios consume the already reviewed report-schema Fixture files through FakePreflightService. No request fixture claims Moss, Monad, RPC, live, or safety evidence. The two LIVE request files are executed only against the existing offline createFakeMossEnvironment; returned provenance remains LOCAL_FORK, never LIVE_SOURCE.

    4. HTTP integration matrix

    tests/integration/preflight-api.test.ts uses real Web request/response contracts and createPreflightHandler. It imports existing server implementations read-only and runs this eight-case matrix twice: once with CLEAR402_ENABLED absent and once set to the string false.

    1. health route: 200, strict HealthResponse, clear402.enabled=false;
    2. happy Fixture: 200, schema-valid correlated response, MANUAL_REVIEW;
    3. amount mismatch Fixture: 200, schema-valid correlated response, STOP with CRITICAL_ALIGNMENT_FAIL and amount source references;
    4. tokenOut mismatch Fixture: 200, schema-valid correlated response, STOP with CRITICAL_ALIGNMENT_FAIL and output-asset source references;
    5. synthetic RPC/simulation acquisition failure: 200 legal report, simulation FAILED, explicit SIMULATION_ACQUISITION_FAILED, STOP;
    6. synthetic warning: 200 legal report, one warning retained, explicit WARNING_PRESENT, STOP;
    7. malformed request: 400 INVALID_REQUEST, no report, presentation, or Decision;
    8. programming/invariant throw: 500 INTERNAL_ERROR, no fake STOP/report/Decision and no sentinel leakage in response or fixed log event.

    That yields exactly 16 integration tests. Each response is parsed with the public response schema where applicable, presentation/report correlation is asserted, and preflight bodies are scanned for Clear402 package/runtime markers and credential-shaped output. Input fixtures are not mutated.

    5. Clear402 and evidence boundary

    The matrix runs fully under both absent and explicit-false environment states, restoring the caller environment after each case. Tests do not import any Clear402 package or profile. Static gate review also scans the changed diff and server orchestration boundary for clear402-profile and @clear402/ imports. The health contract's existing literal clear402.enabled=false is expected metadata, not a dependency.

    All chain-like values used by LIVE integration cases come from the existing offline FakeMoss helper and retain synthetic/LOCAL_FORK provenance. No test reads MOSS_RPC_URL, opens a socket, invokes the #29 live runner, or treats Fixture values as real evidence.

    6. Dev/curl reproduction

    After tests pass, start the shipped dev server with CLEAR402_ENABLED absent, then explicitly false, and reproduce:

    curl -fsS http://127.0.0.1:3000/api/health | jq
    curl -sS -X POST http://127.0.0.1:3000/api/preflight -H 'content-type: application/json' --data @fixtures/requests/happy.json | jq '.report.decision'
    curl -sS -X POST http://127.0.0.1:3000/api/preflight -H 'content-type: application/json' --data @fixtures/requests/amount-mismatch.json | jq '.report.decision'
    curl -sS -X POST http://127.0.0.1:3000/api/preflight -H 'content-type: application/json' --data @fixtures/requests/token-out-mismatch.json | jq '.report.decision'

    Expected: health ok with Clear402 false; happy MANUAL_REVIEW; both mismatches STOP. The test-only injected failure/warning/invariant cases are not exposed as new production scenarios or query parameters.

    7. Gate report and exact SHA rule

    Implementation is two-phase so docs/m2-gate-report.md can truthfully contain an immutable exact behavioral subject SHA:

    1. commit only the script, seven requests, and integration test;
    2. run pnpm test:integration, pnpm check, curl reproduction, scope/security scans, and record the exact behavioral commit SHA and test counts;
    3. add only docs/m2-gate-report.md as a report-only follow-up commit;
    4. run all gates again on the final PR head and freeze that final head/tree in PR/Issue evidence.

    The report records date, Node/pnpm, baseline SHA, exact tested behavioral SHA, final PR head in linked immutable PR evidence, 16 integration-test count, full-suite count, curl results, Clear402 states, provenance limits, known production-audit baseline, and the sole verdict PASS or NO-GO. It never calls MANUAL_REVIEW a gate failure and never calls STOP a safety proof.

    8. Defect handling

    The gate PR must not repair business behavior. If any acceptance case fails because of product code, schema, Fixture report, orchestrator, handler, route, or package behavior:

    Only mistakes inside the authorized request/test/report/script files may be corrected within #34.

    9. Verification

    Node 22.23.1, pnpm 11.16.0, fresh isolated checkout:

    pnpm install --frozen-lockfile
    pnpm test:integration
    pnpm check
    pnpm dev
    git diff --check origin/main...HEAD
    git diff --name-only origin/main...HEAD
    git status --short

    Additional audit:

    • exact ten-path diff and no lockfile/workflow/dependency/product-source drift;
    • 16/16 matrix tests under absent/false Clear402;
    • public schemas parse all success/error bodies;
    • no response/log sentinel leakage;
    • no Clear402 import/runtime marker in the preflight responses or changed executable paths;
    • exact-head required quality-gate SUCCESS;
    • separate clean detached SINGLE_OPERATOR_QA repeats frozen install, integration/full tests, both dev/curl modes, and scope/security checks.

    10. Acceptance and rollback

    PASS requires every Issue acceptance item, 16/16 integration cases, full pnpm check, both curl modes, exact-head CI, exact path audit, and no open defect. Otherwise verdict is NO-GO.

    Rollback is deletion/revert of only the #34 test/report branch or squash commit. It has no application state, chain state, database, deployment, secret, wallet, or transaction rollback.

    11. Stop conditions

    Stop for a replacement Scope Gate before any eleventh path, product-source/schema/Fixture-report change, dependency/lockfile/workflow change, live network call, new production scenario/switch, Clear402 import, secret, wallet/signing/submission surface, or non-PASS/NO-GO verdict vocabulary.

    12. Requested decision

    Record either:

    • SCOPE_CONFIRMED / IMPLEMENTATION_AUTHORIZED accepting the baseline, ten paths including the one-line root script correction, 16-case matrix, two-phase exact-SHA report, no-business-fix rule, verification, and stop conditions; or
    • SCOPE_CHANGES_REQUESTED naming the exact required change.

    Until confirmed: QA_WORK_PLAN_SUBMITTED / AWAITING_MAINTAINER_SCOPE_CONFIRMATION.

  5. pillowtalk-Qy commented on Aug 8, 2026

    @pillowtalk-Qy
    ContributorAuthor

    SCOPE_CONFIRMED / IMPLEMENTATION_AUTHORIZED

    Frozen authorization object:

    Maintainer confirms the complete #34 QA Work Plan.

    Authorized writable paths, exactly:

    1. package.json
    2. fixtures/requests/happy.json
    3. fixtures/requests/amount-mismatch.json
    4. fixtures/requests/token-out-mismatch.json
    5. fixtures/requests/rpc-failure.json
    6. fixtures/requests/warning.json
    7. fixtures/requests/malformed.json
    8. fixtures/requests/programming-error.json
    9. tests/integration/preflight-api.test.ts
    10. docs/m2-gate-report.md

    Frozen requirements:

    • root package.json may add only test:integration = pnpm build && vitest run tests/integration; no other script or metadata change;
    • exactly seven strict, credential-free request JSON files with the scenario roles specified in the plan;
    • exactly 16 HTTP-boundary integration cases: eight cases under CLEAR402_ENABLED absent and the same eight under explicit false;
    • happy MANUAL_REVIEW; amount/token mismatch STOP; synthetic RPC/simulation acquisition failure explicit FAILED evidence/STOP; warning retained/STOP; malformed 4xx without Decision; programming/invariant 5xx without fake STOP; health succeeds;
    • public response schemas and report/presentation correlation remain mandatory;
    • existing product, schema, Fixture report, handler, orchestrator, route and FakeMoss helper files are read-only;
    • no live network, LIVE_SOURCE claim, Clear402 import/runtime, secret, wallet, signer, transaction, deployment, dependency, lockfile or workflow change;
    • two-phase commit records the exact behavioral subject SHA and counts in docs/m2-gate-report.md, followed by final-head full verification;
    • any product defect opens a separate minimal Bug Issue, makes the gate NO-GO, and is not fixed in M2-13: Pass non-UI end-to-end integration gate #34;
    • gate verdict vocabulary is only PASS or NO-GO.

    Gate operator is authorized to create only:

    • branch: codex/issue-34-non-ui-gate
    • isolated worktree: /Users/qy/Documents/moss-mini-demo-issue-34

    Both must start from the exact authorized baseline. Any eleventh path or change to the frozen metadata, matrix, evidence, product-read-only, offline, defect, verdict, or no-submission boundary invalidates this authorization and requires a replacement Scope Gate.

    This authorizes gate implementation scope only. It is not SINGLE_OPERATOR_QA PASS, Gate PASS, Review approval, READY_TO_MERGE, Merge Gate, or merge authorization. Deliver a Draft PR closing #34, obtain exact-head quality-gate, and complete clean same-operator QA on the frozen head. No independent reviewer is claimed.

  6. pillowtalk-Qy commented on Aug 8, 2026

    @pillowtalk-Qy
    ContributorAuthor

    POST_MERGE_AUDIT: main 1e1611b9f6084f8f787b9d689ce05a9f354a56f4; merged-main quality-gate run 31247416874 SUCCESS; Issue Closed/Completed; Project Done; branch/worktrees cleaned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:qaQuality assurance and testingpriority:P0Critical prioritytype:choreRepository maintenance

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions