{"record":{"id":"ebce4337b2d4c9c4","repo":"github/spec-kit","slug":"staged-workflow-file-changed-before-commit","errorCode":null,"errorMessage":"Staged workflow file changed before commit","messagePattern":"Staged workflow file changed before commit","errorType":"exception","errorClass":"OSError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/workflows/_commands.py","lineNumber":591,"sourceCode":"        for chunk in chunks:\n            view = memoryview(chunk)\n            while view:\n                written = os.write(self.fd, view)\n                if written <= 0:\n                    raise OSError(\"Failed to write staged workflow file\")\n                view = view[written:]\n\n    def write_bytes(self, data: bytes) -> None:\n        self._write((data,))\n\n    def verify_path(self) -> None:\n        import stat\n\n        try:\n            path_stat = self.path.stat(follow_symlinks=False)\n            open_stat = os.fstat(self.fd)\n        except OSError as exc:\n            raise OSError(\n                \"Staged workflow file changed before commit\"\n            ) from exc\n        if (\n            not stat.S_ISREG(path_stat.st_mode)\n            or path_stat.st_dev != open_stat.st_dev\n            or path_stat.st_ino != open_stat.st_ino\n        ):\n            raise OSError(\"Staged workflow file changed before commit\")\n\n    def set_mode(self, mode: int) -> None:\n        if hasattr(os, \"fchmod\"):\n            os.fchmod(self.fd, mode)\n\n    def close(self) -> None:\n        if self.fd < 0:\n            return\n        fd, self.fd = self.fd, -1\n        try:","sourceCodeStart":573,"sourceCodeEnd":609,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/workflows/_commands.py#L573-L609","documentation":"Error \"Staged workflow file changed before commit\" thrown in github/spec-kit.","triggerScenarios":"Thrown at src/specify_cli/workflows/_commands.py:591 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Avoid concurrent modification of the staged workflow file and retry the install."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}