{
  "title": "M6 R3.1 在线Resume/Cancel与存活worker受控竞争专项",
  "recordedAt": "2026-11-03T01:43:17.538324+00:00",
  "fagoCommit": "4b3f755b8ae36dab1c038856949d63fdd6cf69a3",
  "schemaVersion": 48,
  "runtime": "fago-form-approval-v3",
  "changes": "Only integration tests and optional API test-helper lease duration; no production implementation, migration, dependencies, frontend or public contract change.",
  "sourceFiles": [
    "fago/fago-server/apps/fago-server/workflow_approval_race_process_test.go",
    "fago/fago-server/apps/fago-server/workflow_api_process_test.go"
  ],
  "controlledMatrix": [
    {
      "action": "resume",
      "order": "worker-first",
      "HTTP": 200,
      "receipt": "done/approved",
      "proof": "old attempt continued; work_fence1 audit exists; original online voter has command.done event after finishing remaining checkpoint"
    },
    {
      "action": "resume",
      "order": "online-first",
      "HTTP": 202,
      "receipt": "accepted then done/approved",
      "proof": "old attempt expired and no work_fence1 audit; live worker claims later fence and completes remainder"
    },
    {
      "action": "cancel",
      "order": "worker-first",
      "HTTP": 409,
      "code": 409001,
      "receipt": "done/approved",
      "proof": "original instance CAS loses after worker advances; failed cancel does not overwrite receipt"
    },
    {
      "action": "cancel",
      "order": "online-first",
      "HTTP": 200,
      "receipt": "done/cancelled",
      "proof": "old attempt expired without work_fence1 audit; continuing live worker cannot revive frozen receipt"
    }
  ],
  "synchronization": {
    "resource": "test-owned form draft row lock; no job/lease/fence mutation",
    "postgres": "blocking chain from parent backend through worker resource wait to online runtime wait, with current DB and fixed table predicates",
    "mysql": "performance_schema actual lock objects, blocking transaction and parent connection chain; no SQL-text visibility assumption",
    "deadline": "worker retains original3s; API helper optional10s only here, default1s preserved; HTTP12s context",
    "lifetime": "one result buffer; main test cancels and joins request; worker survives terminal receipt and at least one subsequent real pool renewal before frozen version recheck"
  },
  "invariants": [
    "exactly one human vote; original command owner retained",
    "140 automatic successors with128-step budget",
    "old attempt/audit distinguish committed checkpoint from complete rollback",
    "Resume must really finish remaining checkpoint, not merely read done",
    "job done; resource slot/grant released; terminal receipt version remains frozen with worker alive",
    "only test-owned processes/locks/resources cleaned; no development service data changed"
  ],
  "databaseMatrix": {
    "mysql": {
      "result": ".cache/m6-r31/integration-20261103T013744Z/mysql-result.json",
      "status": "passed",
      "cleanup": true,
      "applicationFilter": "^TestIntegrationWorkflow(ApprovalProcessRace|AcceptedSignalProcess|APIProcess)$",
      "applicationTopLevelPassed": 3,
      "newControlledRaceScenariosPassed": 4,
      "previousRealProcessRecoveryScenariosPassed": 3,
      "originalAPILifecycleRegression": "passed",
      "migrationTopLevelPassed": 18,
      "race": true,
      "transport": "actual plaintext HTTP; previous crypto matrix retained separately"
    },
    "postgres": {
      "result": ".cache/m6-r31/integration-20261103T013744Z/postgres-result.json",
      "status": "passed",
      "cleanup": true,
      "applicationFilter": "^TestIntegrationWorkflow(ApprovalProcessRace|AcceptedSignalProcess|APIProcess)$",
      "applicationTopLevelPassed": 3,
      "newControlledRaceScenariosPassed": 4,
      "previousRealProcessRecoveryScenariosPassed": 3,
      "originalAPILifecycleRegression": "passed",
      "migrationTopLevelPassed": 18,
      "race": true,
      "transport": "actual plaintext HTTP; previous crypto matrix retained separately"
    }
  },
  "checks": {
    "workspace": "26 modules race/vet passed with default linker; integration environment disabled here",
    "independent": "changed apps/fago-server full-package GOWORKoff race with fresh cache/source copy passed; default linker and checksum verification retained",
    "moduleBoundaries": "28 metadata modules explicit requires/DAG/internal passed;26 workspace modules",
    "style": "gofmt/120-character/4-or-more-argument AST layout/git diff checks passed",
    "readOnlyReview": "no must-fix findings, including revised MySQL wait chain and audit checks",
    "golangciLint": "not installed; not claimed passed",
    "frontendContractDM": "unchanged and not rerun; no new certification"
  },
  "failedAttempts": [
    {
      "scope": "initial unit and integration-20261103T012809Z",
      "reason": "new test unused import and Envelope.Code int mismatch prevented compilation; corrected before functional scenarios",
      "cleanup": true
    },
    {
      "directory": ".cache/m6-r31/integration-20261103T013100Z",
      "reason": "PG3parent+18migration passed; MySQL SQL-text wait-chain observer did not recognize controlled waiter; whole dual run not passed; replaced with physical-lock observer and reran complete dual scope",
      "cleanup": true,
      "additionalFix": "failure context may auto rollback before cleanup; tolerate only sql.ErrTxDone, retain other errors"
    }
  ],
  "diagnosticRuns": [
    {
      "directory": ".cache/m6-r31/integration-20261103T012850Z",
      "scope": "PG new4race scenarios only +18migrations; not final full regression"
    },
    {
      "directory": ".cache/m6-r31/integration-20261103T013551Z",
      "scope": "MySQL resume/worker-first only +18migrations; not whole matrix"
    }
  ],
  "browser": {
    "status": "not run",
    "reason": "Local browser use is disabled in Work settings; availability rechecked"
  },
  "limitations": [
    "four controlled orders, not all possible timing/fault permutations",
    "command/timer/ready/external combined recovery pending",
    "full multiversion rolling,backlog,lockwait,recovery and capacity baseline pending",
    "remaining resource/command scope and complete W01-W12 audit pending",
    "actual browser product/docs acceptance pending",
    "not production/seven-database/DM certification"
  ],
  "logs": [
    {
      "path": ".cache/m6-r31/approval-race-dual-final.log",
      "sha256": "541ed147eb65914c0cc76cbd29b9a7509a9283f87a2a0e8bef44093c5f280c69"
    },
    {
      "path": ".cache/m6-r31/approval-race-workspace-final.log",
      "sha256": "dd5ce3b29d20a3ba0c9efb4c06f5f63a9bc49abf5c06fe85f54924cf15aa2fff"
    },
    {
      "path": ".cache/m6-r31/approval-race-independent-final.log",
      "sha256": "6edc86cda8d681663da1743adcedd540c841442872b72f8d6efa8b96bfa2880a"
    },
    {
      "path": ".cache/m6-r31/approval-race-modules.log",
      "sha256": "8afe1703dadeefd6535ed863a7416cf0ceef22315318c5303f1803ee139c5b90"
    },
    {
      "path": ".cache/m6-r31/approval-race-style.log",
      "sha256": "4caadc32e73d5a6a55adc6f253acf0bb5a50fbe404a914ea2df7b406e18b4b58"
    }
  ],
  "privacy": "Only counts/scope/invariants/log digests are public; no raw SQL metadata, connection identities, job owners, request bodies, opinions, credentials or original recovery material."
}
