Add skill-lib governed dynamic repository SITREP - #41
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f47cc4424
ℹ️ 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".
| try { | ||
| reportRecords.set(definition.repository, await collectReport(definition, workDir)); | ||
| } catch (error) { | ||
| missingReports.push({ repository: definition.repository, reason: error.message }); |
There was a problem hiding this comment.
Do not publish curl errors containing the GitHub token
When a repository-report request fails while GITHUB_TOKEN is set, Node's execFileSync error message includes the full curl arguments, including Authorization: Bearer .... Storing that raw message in missingReports exposes the credential through the generated assets/data/sitrep.json; the outer fallback path similarly publishes it as fallbackReason. Sanitize public errors or ensure the authorization value can never appear in captured command errors.
Useful? React with 👍 / 👎.
|
|
||
| async function fallbackData(reason) { | ||
| try { | ||
| const previous = JSON.parse(await readFile('src/_data/snapshots/sitrep.last-known-good.json', 'utf8')); |
There was a problem hiding this comment.
Persist the last-known-good snapshot across Pages runs
In the hourly Pages workflow, every build starts from a fresh checkout, but a repo-wide search shows src/_data/snapshots/sitrep.last-known-good.json is neither tracked nor recovered from the previous deployment. Therefore, if GitHub or skill-lib is temporarily unavailable before this run writes a fresh snapshot, this read always fails and the successful build deploys five empty project records over the previously good SITREP rather than using the advertised last-known-good data.
Useful? React with 👍 / 👎.
| const sourceCommit = reportRecord?.report?.source?.commit || null; | ||
| const head = telemetry?.head || null; | ||
| let reportFreshness = 'unknown'; | ||
| if (sourceCommit && head) reportFreshness = sourceCommit === head ? 'current' : 'stale'; |
There was a problem hiding this comment.
Account for the report commit when computing freshness
When a report's source.commit identifies the repository state described by the report—as the newly added website report explicitly does—the report itself is committed afterward, so repository HEAD necessarily differs from that source commit. Direct equality consequently labels a freshly published report stale immediately, and another report-refresh commit cannot clear the label because it advances HEAD again; freshness needs to recognize report-only descendant commits or use the commit that contains the report.
Useful? React with 👍 / 👎.
| <div><dt>Workflow</dt><dd>{% if project.telemetry.latestWorkflow %}{{ project.telemetry.latestWorkflow.conclusion or project.telemetry.latestWorkflow.status or 'hmmm' }}{% else %}hmmm{% endif %}</dd></div> | ||
| </dl> | ||
| {% if project.telemetry.latestWorkflow %} | ||
| <div class="status-row"><span class="status {% if project.telemetry.latestWorkflow.conclusion == 'success' %}status-implemented{% elif project.telemetry.latestWorkflow.conclusion == 'failure' %}status-risk{% else %}status-hmmm{% endif %}">CI {{ project.telemetry.latestWorkflow.conclusion or project.telemetry.latestWorkflow.status }}</span></div> |
There was a problem hiding this comment.
Tie the displayed CI result to the observed HEAD
When the latest workflow run belongs to an earlier commit or to an unrelated workflow, the template still labels its conclusion as CI success beside the repository's current HEAD. The collector already records latestWorkflow.headSha and the workflow name, but neither is checked or displayed here, so a new untested or failing HEAD can appear to have successful CI until another run becomes latest.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d01bec47e
ℹ️ 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".
| const pulls = tryGetJson(githubApiUrl(`/repos/${encodeURIComponent(org)}/${encodeURIComponent(definition.name)}/pulls`, { | ||
| state: 'open', | ||
| per_page: 100 | ||
| })) || []; |
There was a problem hiding this comment.
Preserve unknown state when pull telemetry fails
When the repository and commit requests succeed but the /pulls request is unavailable or rate-limited, tryGetJson(...) || [] converts that failure into an empty list, causing the public SITREP to report Open PRs: 0 rather than an unavailable value. Keep the failure as null so a telemetry outage cannot be presented as evidence that the repository has no open pull requests.
Useful? React with 👍 / 👎.
| sourceSnapshotAt: null, | ||
| controlPlane, | ||
| portfolio: null, | ||
| missingReports: projectDefinitions.map(project => project.repository), |
There was a problem hiding this comment.
Keep fallback missing-report records schema-compatible
When a total refresh failure occurs before any snapshot exists, this fallback emits missingReports as repository-name strings, while the normal collection path emits objects containing repository and reason. Because both payloads advertise the same schema/version at the public machine-readable route, consumers that read entry.repository will break precisely during the first-run outage scenario; emit the same record shape in both modes.
Useful? React with 👍 / 👎.
| <div><dt>Schema blob</dt><dd><code>{{ generated.sitrep.controlPlane.reportSchemaBlob | truncate(12, true, '') }}</code></dd></div> | ||
| <div><dt>skill-lib commit</dt><dd><code>{{ generated.sitrep.controlPlane.commit | truncate(12, true, '') }}</code></dd></div> | ||
| <div><dt>Projection</dt><dd>{% if generated.sitrep.portfolio %}<code>{{ generated.sitrep.portfolio.portfolio_plan_sha256 | truncate(12, true, '') }}</code>{% else %}<span class="status status-hmmm">hmmm</span>{% endif %}</dd></div> | ||
| <div><dt>Snapshot</dt><dd>{{ generated.sitrep.snapshotAt | dateOnly }}</dd></div> |
There was a problem hiding this comment.
Display the retained snapshot's actual timestamp
When fallback data is loaded from a retained snapshot, fallbackData sets snapshotAt to the current refresh attempt and stores the data's real age in sourceSnapshotAt, but this page displays only snapshotAt. The fallback banner therefore accompanies a misleadingly current “Snapshot” date even though all repository claims and telemetry may be much older; use sourceSnapshotAt for this field whenever fallback is active.
Useful? React with 👍 / 👎.
What
Adds a public
/sitrep/surface for METAPAT, UCNS, EDCM, a0, and the website itself.Authority / provenance
docs/work-graphs/repository-plan-report.jsonskill-lib/interdependent-work-graph/portfolio_plan.pyPublic surfaces
/sitrep/dynamic infograms/assets/data/sitrep.jsonmachine-readable presentation viewrepository_dispatchtriggerValidation
Adds authority/provenance tests and runs through the existing full site, browser, accessibility, generated-route, and link gates.
hmmm
Producer-side
org-repo-updateddispatch is not yet installed across the participating repositories; hourly refresh provides bounded eventual update until that is deliberately selected.