-
Notifications
You must be signed in to change notification settings - Fork 0
Expand current work graph and repair report freshness #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ import path from 'node:path'; | |
| // network: reads public GitHub repository metadata and repo-owned reports; optional token raises rate limits | ||
| // storage: writes generated and last-known-good SITREP JSON only | ||
| // authority: skill-lib owns the reporting contract and deterministic projection; each repository owns its report claims; this site owns presentation only | ||
| // failure: never reconstructs missing reports; never publishes raw command errors or credentials; missing or HEAD-different sources remain visible and a last-known-good projection may be used only with fallback=true | ||
| // failure: never reconstructs missing reports; never publishes raw command errors or credentials; missing or source-different reports remain visible and a last-known-good projection may be used only with fallback=true | ||
| // === END BOUNDARIES === | ||
| // Usage: run `npm run refresh:sitrep`; the output is presentation data, not a new source of repository canon. | ||
|
|
||
|
|
@@ -28,7 +28,7 @@ const localReportPath = 'docs/work-graphs/repository-plan-report.json'; | |
| // reinterpret repo reports when skill-lib main changes. | ||
| const controlPlane = { | ||
| repository: `${org}/skill-lib`, | ||
| commit: '6ef2e4c123225f9db20e5230e5894c9c86b42ee6', | ||
| commit: 'c14ee9d500579a4b5d6821f62c9d82ca96e73608', | ||
| skill: 'interdependent-work-graph', | ||
| reportSchemaVersion: '1.0.0', | ||
| reportSchemaPath: 'interdependent-work-graph/repository-plan-report.schema.json', | ||
|
|
@@ -37,11 +37,20 @@ const controlPlane = { | |
| portfolioScriptBlob: '97b8b546b4151486164c8a4b730c24a8c895b25b' | ||
| }; | ||
|
|
||
| // Explicit portfolio membership: this is the evidence-bounded core graph, not | ||
| // organization-wide repository discovery. Repositories outside this set remain | ||
| // outside the current projection until a deliberate membership decision adds them. | ||
| const projectDefinitions = [ | ||
| { repository: `${org}/skill-lib`, name: 'skill-lib', label: 'Skill Library', slug: 'skill-lib' }, | ||
| { repository: `${org}/metapat`, name: 'metapat', label: 'METAPAT', slug: 'metapat' }, | ||
| { repository: `${org}/ucns`, name: 'ucns', label: 'UCNS', slug: 'ucns' }, | ||
| { repository: `${org}/edcm`, name: 'edcm', label: 'EDCM', slug: 'edcm' }, | ||
| { repository: `${org}/pcea`, name: 'pcea', label: 'PCEA', slug: 'pcea' }, | ||
| { repository: `${org}/ptcna`, name: 'ptcna', label: 'PTCNA', slug: 'ptcna' }, | ||
| { repository: `${org}/epac`, name: 'epac', label: 'EPAC', slug: 'epac' }, | ||
| { repository: `${org}/zfae`, name: 'zfae', label: 'ZFAE', slug: 'zfae' }, | ||
| { repository: `${org}/a0`, name: 'a0', label: 'a0', slug: 'a0' }, | ||
| { repository: `${org}/stack`, name: 'stack', label: 'Stack', slug: 'stack' }, | ||
|
Comment on lines
+48
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Expanding the portfolio to 11 repositories leaves several user-facing strings describing the old scope: Useful? React with 👍 / 👎. |
||
| { repository: websiteRepository, name: 'The-Interdependency.github.io', label: 'Website', slug: 'website', localReport: true } | ||
| ]; | ||
|
|
||
|
|
@@ -143,6 +152,8 @@ function collectTelemetry(definition) { | |
| return { | ||
| branch, | ||
| head: commit.sha || null, | ||
| parents: (commit.parents || []).map(parent => parent.sha).filter(Boolean), | ||
| changedFiles: (commit.files || []).map(file => file.filename).filter(Boolean), | ||
| headDate: commit.commit?.committer?.date || commit.commit?.author?.date || null, | ||
| pushedAt: repo.pushed_at || null, | ||
| updatedAt: repo.updated_at || null, | ||
|
|
@@ -162,8 +173,15 @@ function collectTelemetry(definition) { | |
| function projectView(definition, reportRecord, telemetry, portfolioView) { | ||
| const sourceCommit = reportRecord?.report?.source?.commit || null; | ||
| const head = telemetry?.head || null; | ||
| const reportOnlyRefresh = Boolean( | ||
| sourceCommit && | ||
| head && | ||
| (telemetry?.parents || []).includes(sourceCommit) && | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For a merge commit, accepting any parent can mark an outdated report current: if the declared source is the second parent while the first parent contains newer substantive work, the commit's changed-file list can still contain only the report relative to the first parent. The intended report-refresh and report-only merge cases use the declared source as the first parent, so this predicate should require that parent specifically rather than using Useful? React with 👍 / 👎. |
||
| (telemetry?.changedFiles || []).length === 1 && | ||
| telemetry.changedFiles[0] === localReportPath | ||
| ); | ||
| let reportFreshness = 'unknown'; | ||
| if (sourceCommit && head) reportFreshness = sourceCommit === head ? 'current' : 'HEAD differs'; | ||
| if (sourceCommit && head) reportFreshness = sourceCommit === head || reportOnlyRefresh ? 'current' : 'HEAD differs'; | ||
| else if (!reportRecord) reportFreshness = 'missing'; | ||
| return { | ||
| ...definition, | ||
|
|
@@ -290,4 +308,4 @@ try { | |
| console.log(`sitrep fallback: ${data.fallbackReason}`); | ||
| } finally { | ||
| if (workDir) await rm(workDir, { recursive: true, force: true }); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the refresh falls back—for example with
OFFLINE=1or during a control-plane API outage—fallbackDataspreads the committed last-known-good snapshot without reconciling it with this expanded list. That snapshot still contains only the original five projects, soskill-lib,pcea,ptcna,epac,zfae, andstackdisappear entirely instead of remaining visible with unavailable reports; an offline run at this commit reproduces a five-project result with the old control-plane commit. Update the bootstrap snapshot or mergeprojectDefinitionsinto fallback data so the explicit current portfolio remains represented.Useful? React with 👍 / 👎.