feat: add contribution lifecycle salvage gate - #13
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce880a07d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function requiredTime(value, label) { | ||
| const normalized = requiredString(value, label, 128); | ||
| const timestamp = Date.parse(normalized); | ||
| if (!Number.isFinite(timestamp)) throw new ContributionLifecycleError(`${label} must be an ISO-8601 timestamp.`); | ||
| return new Date(timestamp).toISOString(); |
There was a problem hiding this comment.
Enforce ISO-8601 timestamps before parsing
Date.parse accepts non-ISO strings despite the error message and lifecycle contract requiring ISO-8601; for example, on the supported Node runtime, "0" is accepted and normalized to 2000-01-01T00:00:00.000Z, and "July 19, 2026" is also accepted. A malformed observedAt, checkedAt, or outcome timestamp can therefore silently alter the chronology checks and assessment fingerprint rather than failing closed. Validate the original string against the supported ISO-8601 form before calling Date.parse.
Useful? React with 👍 / 👎.
Summary
pcf lifecycleWhy
A closed, stale, or no-longer-cherry-pickable PR is not enough information to decide whether the underlying engineering was invalid. PCF needs a fail-closed way to distinguish current patches, rebaseable drift, durable invariants, partial supersession, equivalent supersession, invalidation, and cases that require a maintainer decision.
Safety and evidence boundary
Validation
npm run ci:gates— repository/CI contract checks, syntax checks, 274/274 tests, 77/77 benchmark cases, 29/29 adversarial cases, and maintainer demo passednpm run mcp:smoke— health, server card, readiness, repro gate, and no-public-write-tool assertions passedgit diff HEAD^ HEAD --check— passedDiff shape
Six files are intentionally in scope: lifecycle engine, CLI wiring, fixture corpus, focused tests, README documentation, and explicit syntax-check registration. No dependency or generated-file churn is included.