diff --git a/.github/workflows/board_tests.yml b/.github/workflows/board_tests.yml index 89ee247..6cd20f0 100644 --- a/.github/workflows/board_tests.yml +++ b/.github/workflows/board_tests.yml @@ -14,9 +14,16 @@ jobs: with: repository: PyAutoLabs/PyAutoBrain path: PyAutoBrain + # Canonical repository identity input; relationships remain in Scientist. + - uses: actions/checkout@v4 + with: + repository: PyAutoLabs/PyAutoMind + path: PyAutoMind + - uses: actions/setup-python@v5 with: python-version: '3.12' - run: python -m pip install pytest pyyaml + - run: python scripts/organism_board.py --repos PyAutoMind/repos.yaml --check-projects - run: python -m pytest tests -q - run: node --test tests/overview.cjs diff --git a/.github/workflows/organism_board.yml b/.github/workflows/organism_board.yml index db76b26..8fd3dd9 100644 --- a/.github/workflows/organism_board.yml +++ b/.github/workflows/organism_board.yml @@ -42,16 +42,24 @@ jobs: repository: PyAutoLabs/PyAutoBrain path: PyAutoBrain + # Canonical repository identity input; relationships remain in Scientist. + - uses: actions/checkout@v4 + with: + repository: PyAutoLabs/PyAutoMind + path: PyAutoMind + - uses: actions/setup-python@v5 with: python-version: "3.12" + - run: python -m pip install pyyaml + - name: Render every surface (public HTTPS only) run: | mkdir -p _site - python scripts/organism_board.py --html > _site/index.html - python scripts/organism_board.py --badge > _site/badge.json - python scripts/organism_board.py --md > board.md + python scripts/organism_board.py --repos PyAutoMind/repos.yaml --html > _site/index.html + python scripts/organism_board.py --repos PyAutoMind/repos.yaml --badge > _site/badge.json + python scripts/organism_board.py --repos PyAutoMind/repos.yaml --md > board.md cp board.md _site/dashboard.md - name: Write the board to the job step summary diff --git a/PROJECTS.md b/PROJECTS.md new file mode 100644 index 0000000..bba91e3 --- /dev/null +++ b/PROJECTS.md @@ -0,0 +1,111 @@ +# Connected projects + +The Scientist home shows **software families** and, when explicitly configured, +**scientific investigations** as separate kinds of project. A software family +is not a Cortex investigation. Cards are a navigational inventory; source +repositories and organs retain their authoritative records. An empty card means +no public resources were configured, not that work or evidence does not exist. + +## Connect or change a project + +Edit the instance-owned `config/projects.json`. Keep stable IDs when renaming a +project or resource. Add repository identities to your canonical Mind +`repos.yaml`, then refer to those keys here; never copy GitHub owners/remotes +into a second repository inventory. Resource IDs can appear in multiple project +cards, including as shared dependencies. Associations are curated, not a complete +package dependency lockfile and not inferred from naming prefixes. + +Each project has `name`, `kind` (`software_family` or `scientific_project`), +optional `description`, `public`, and a `resources` object. Its optional lists +are `software`, `dependencies`, `workspaces`, `tutorials`, `documentation`, +`assistants` and `records`. Each list contains resource IDs, in display order. +An assistant is never required. An empty project catalogue is supported. + +Each resource has `name`, `public`, and one or both of: + +- `repo`: a key from the canonical identity map. Optional repository-relative + `path` and `ref` point at a folder or file. With a path and no ref, `main` is + used; set ref explicitly for other default branches or a pinned revision. +- `published_url`: an explicit HTTPS destination, such as external documentation + or an owning organ's board. This is a published location, not a second repo ID. + +The version-1 format is a JSON object with `schema_version: 1`, `resources` +and `projects` objects keyed by stable lowercase, hyphen-separated IDs. +For example, given `analysis-code` in your own identity map: + +```json +{ + "schema_version": 1, + "resources": { + "analysis-guide": { + "name": "Analysis guide", "repo": "analysis-code", + "path": "docs", "ref": "main", "public": true + } + }, + "projects": { + "spectra": { + "name": "Spectra", "kind": "scientific_project", "public": true, + "resources": {"documentation": ["analysis-guide"]} + } + } +} +``` + +Validate without collecting feeds: + +```bash +python scripts/organism_board.py --projects config/projects.json \ + --repos /path/to/YourMind/repos.yaml --check-projects +``` + +Use the same arguments with `--html`, `--md` or `--json` to render. A configured +workspace can supply `PYAUTO_MIND`; otherwise Brain's manifest-backed resolver +locates Mind. An unavailable map or invalid relationship fails rendering instead +of publishing a misleading empty catalogue. Rendering never fetches linked +content or executes project code. Ordinary organ feed refresh remains unchanged. + +## Publication and ownership + +Only projects **and** resources explicitly marked `public: true` enter the +rendered snapshot. Omitted/false values exclude them from HTML, Markdown and +embedded JSON. This flag records an owner's publication decision; it does not +check remote repository permissions. Review links and metadata before enabling +it. The configuration in this repository is itself public: never put private +project details here, even under `public: false`. Use a private instance/local +configuration for private material. Connecting resources changes no permissions. + +Project repositories own software, docs, notebooks, scripts, assistant definitions +and runners. Scientist owns these explicit project associations and links. The +agreed Broca expansion covers communication/documentation relationships and +upkeep evidence, with documentation, tutorials, user-facing workspaces and +assistants as first-class surfaces. Its current published implementation still +covers assistant evidence; the broader contract and evidence migration are +separate Mind tasks. These IDs/categories provide a coordination point, not a +new Broca evidence schema or copied ledger. A shared Broca inventory link does +not imply a project-specific assessment. + +Ears retains listening and feedback collection; Brain interprets and routes; +Mind tracks implementation; Memory holds knowledge and citations; Cortex owns +scientific records and human conclusions; Eyes owns gallery evidence; Heart +owns readiness; Hands owns builds/releases. A project may link any relevant +owner record without transferring ownership. Inventory presence, technical +validation, freshness and explanatory quality remain distinct. No external +messages, publication actions, evaluation runs or setup actions happen on a +card click or dashboard refresh. + +## Adoption and upgrades + +`config/projects.json` is user-owned configuration. `scripts/project_resources.py` +is framework logic; it contains no project names, GitHub owners or repository +suffix assumptions. The canonical identity map remains independently owned in +Mind. Rename displays or change canonical locations without changing stable IDs. +Unsupported schema versions fail explicitly; an upgrade must preserve the +configuration and user records or supply a reviewable migration. + +This phase does **not** yet make the complete Scientist independently named or +organs optional. Existing hero branding, organ membership, check-in prompt, +workflow checkout identities and framework discovery still reflect the current +instance. Starter packaging, configurable capability locations, optional-organ +activation and record-preserving upgrades are recorded follow-ups. No +collaborator project or access is assumed. Shared multi-contributor operation is +a later milestone. diff --git a/README.md b/README.md index a7f0f59..bcadd8e 100644 --- a/README.md +++ b/README.md @@ -119,3 +119,7 @@ summary across all organs over the last 24 hours, a chosen date range, or help coordinating work across organs. [Reporting guidance](REPORTING.md) defines source coverage, event dates and concise evidence-linked summaries. Detailed work and authoritative records remain with each organ. + +## Connected projects + +The dashboard includes expandable project cards linking software, shared dependencies, documentation, tutorials, workspaces, assistants and owner records. See [the project configuration contract](PROJECTS.md) to connect resources; an assistant is optional and source records remain with their owners. diff --git a/config/projects.json b/config/projects.json new file mode 100644 index 0000000..c1d5983 --- /dev/null +++ b/config/projects.json @@ -0,0 +1,339 @@ +{ + "schema_version": 1, + "resources": { + "fit": { + "name": "PyAutoFit", + "public": true, + "repo": "PyAutoFit" + }, + "fit-workspace": { + "name": "autofit_workspace", + "public": true, + "repo": "autofit_workspace" + }, + "fit-tutorials": { + "name": "HowToFit", + "public": true, + "repo": "HowToFit" + }, + "fit-docs": { + "name": "PyAutoFit documentation", + "public": true, + "repo": "PyAutoFit", + "path": "docs", + "published_url": "https://pyautofit.readthedocs.io/en/latest/" + }, + "fit-assistant": { + "name": "autofit_assistant", + "public": true, + "repo": "autofit_assistant" + }, + "fit-profiling": { + "name": "autofit_profiling", + "public": true, + "repo": "autofit_profiling" + }, + "fit-inference": { + "name": "autofit_inference", + "public": true, + "repo": "autofit_inference" + }, + "fit-visualization": { + "name": "autofit_visualization", + "public": true, + "repo": "autofit_visualization" + }, + "array": { + "name": "PyAutoArray", + "public": true, + "repo": "PyAutoArray" + }, + "galaxy": { + "name": "PyAutoGalaxy", + "public": true, + "repo": "PyAutoGalaxy" + }, + "galaxy-workspace": { + "name": "autogalaxy_workspace", + "public": true, + "repo": "autogalaxy_workspace" + }, + "galaxy-tutorials": { + "name": "HowToGalaxy", + "public": true, + "repo": "HowToGalaxy" + }, + "galaxy-docs": { + "name": "PyAutoGalaxy documentation", + "public": true, + "repo": "PyAutoGalaxy", + "path": "docs", + "published_url": "https://pyautogalaxy.readthedocs.io/en/latest/" + }, + "galaxy-assistant": { + "name": "autogalaxy_assistant", + "public": true, + "repo": "autogalaxy_assistant" + }, + "lens": { + "name": "PyAutoLens", + "public": true, + "repo": "PyAutoLens" + }, + "lens-workspace": { + "name": "autolens_workspace", + "public": true, + "repo": "autolens_workspace" + }, + "lens-tutorials": { + "name": "HowToLens", + "public": true, + "repo": "HowToLens" + }, + "lens-docs": { + "name": "PyAutoLens documentation", + "public": true, + "repo": "PyAutoLens", + "path": "docs", + "published_url": "https://pyautolens.readthedocs.io/en/latest/" + }, + "lens-assistant": { + "name": "autolens_assistant", + "public": true, + "repo": "autolens_assistant" + }, + "lens-profiling": { + "name": "autolens_profiling", + "public": true, + "repo": "autolens_profiling" + }, + "lens-inference": { + "name": "autolens_inference", + "public": true, + "repo": "autolens_inference" + }, + "lens-visualization": { + "name": "autolens_visualization", + "public": true, + "repo": "autolens_visualization" + }, + "reduce": { + "name": "PyAutoReduce", + "public": true, + "repo": "PyAutoReduce" + }, + "reduce-workspace": { + "name": "autoreduce_workspace", + "public": true, + "repo": "autoreduce_workspace" + }, + "cti": { + "name": "PyAutoCTI", + "public": true, + "repo": "PyAutoCTI" + }, + "cti-workspace": { + "name": "autocti_workspace", + "public": true, + "repo": "autocti_workspace" + }, + "cti-docs": { + "name": "PyAutoCTI documentation", + "public": true, + "repo": "PyAutoCTI", + "path": "docs", + "published_url": "https://pyautocti.readthedocs.io/en/latest/" + }, + "cti-assistant": { + "name": "autocti_assistant", + "public": true, + "repo": "autocti_assistant" + }, + "nerves": { + "name": "PyAutoNerves", + "public": true, + "repo": "PyAutoNerves" + }, + "broca-assistants": { + "name": "Broca assistant evidence (shared inventory)", + "public": true, + "repo": "PyAutoBroca", + "path": "assistants.json", + "published_url": "https://pyautolabs.github.io/PyAutoBroca/" + }, + "array-docs": { + "name": "PyAutoArray documentation source", + "repo": "PyAutoArray", + "path": "docs", + "public": true + }, + "reduce-guide": { + "name": "PyAutoReduce project guide", + "repo": "PyAutoReduce", + "path": "README.md", + "public": true + } + }, + "projects": { + "fit": { + "name": "PyAutoFit", + "kind": "software_family", + "public": true, + "description": "Model fitting and non-linear inference.", + "resources": { + "software": [ + "fit" + ], + "dependencies": [ + "nerves" + ], + "workspaces": [ + "fit-workspace" + ], + "tutorials": [ + "fit-tutorials" + ], + "documentation": [ + "fit-docs" + ], + "assistants": [ + "fit-assistant" + ], + "records": [ + "broca-assistants", + "fit-profiling", + "fit-inference", + "fit-visualization" + ] + } + }, + "array": { + "name": "PyAutoArray", + "kind": "software_family", + "public": true, + "description": "Arrays, grids, masks and inversions shared across software families.", + "resources": { + "software": [ + "array" + ], + "dependencies": [ + "nerves" + ], + "documentation": [ + "array-docs" + ] + } + }, + "galaxy": { + "name": "PyAutoGalaxy", + "kind": "software_family", + "public": true, + "description": "Galaxy profiles and modelling.", + "resources": { + "software": [ + "galaxy" + ], + "dependencies": [ + "array", + "fit", + "nerves" + ], + "workspaces": [ + "galaxy-workspace" + ], + "tutorials": [ + "galaxy-tutorials" + ], + "documentation": [ + "galaxy-docs" + ], + "assistants": [ + "galaxy-assistant" + ], + "records": [ + "broca-assistants" + ] + } + }, + "lens": { + "name": "PyAutoLens", + "kind": "software_family", + "public": true, + "description": "Strong-lensing modelling.", + "resources": { + "software": [ + "lens" + ], + "dependencies": [ + "galaxy", + "array", + "fit", + "nerves" + ], + "workspaces": [ + "lens-workspace" + ], + "tutorials": [ + "lens-tutorials" + ], + "documentation": [ + "lens-docs" + ], + "assistants": [ + "lens-assistant" + ], + "records": [ + "broca-assistants", + "lens-profiling", + "lens-inference", + "lens-visualization" + ] + } + }, + "reduce": { + "name": "PyAutoReduce", + "kind": "software_family", + "public": true, + "description": "Imaging reduction into modelling-ready datasets.", + "resources": { + "software": [ + "reduce" + ], + "workspaces": [ + "reduce-workspace" + ], + "documentation": [ + "reduce-guide" + ] + } + }, + "cti": { + "name": "PyAutoCTI", + "kind": "software_family", + "public": true, + "description": "Charge transfer inefficiency modelling and calibration.", + "resources": { + "software": [ + "cti" + ], + "dependencies": [ + "array", + "fit", + "nerves" + ], + "workspaces": [ + "cti-workspace" + ], + "documentation": [ + "cti-docs" + ], + "assistants": [ + "cti-assistant" + ], + "records": [ + "broca-assistants" + ] + } + } + } +} diff --git a/scripts/organism_board.py b/scripts/organism_board.py index 8c7c695..b9f7d9e 100644 --- a/scripts/organism_board.py +++ b/scripts/organism_board.py @@ -203,6 +203,9 @@ def _render_md(snapshot: dict) -> str: head = b.get("headline") or "unavailable" link = f"[{b['name']}]({b['url']})" if b.get("url") else b["name"] lines.append(f"| {link} | {head} | {b['role']} |") + if "project_resources" in snapshot: + from project_resources import render_markdown + lines.extend(["", render_markdown(snapshot["project_resources"])]) return "\n".join(lines) @@ -240,6 +243,8 @@ def _row_id(name: str) -> str: .organ-content a{display:inline-block;min-height:44px} .organ-foot{display:flex;justify-content:space-between;gap:1rem;align-items:center;margin:.8rem 0 0;font-size:.82rem;color:var(--muted);flex-wrap:wrap} .organ-foot a{min-height:44px;display:inline-flex;align-items:center} +.project-card ul{list-style:none;padding:0;margin:0} +.project-card li{margin:0 0 .35rem} .organ-grid :focus-visible{outline:3px solid var(--accent);outline-offset:3px} @media(max-width:64rem){.organ-grid{grid-template-columns:repeat(2,minmax(0,1fr))}} @media(max-width:40rem){.organ-grid{grid-template-columns:1fr}.organ-content .summary-row{grid-template-columns:1fr;gap:.15rem}} @@ -255,6 +260,8 @@ def _render_html(snapshot: dict) -> str: refreshed_at=(snapshot.get("generated") if snapshot.get("boards") and all(row.get("headline") is not None for row in snapshot["boards"]) else None), refresh_url=(f"https://github.com/{owner}/PyAutoScientist/actions/workflows/organism_board.yml" if owner else None)) + from project_resources import render_html as render_projects + projects_html = render_projects(snapshot["project_resources"]) if "project_resources" in snapshot else "" rows = [] for row in snapshot.get("boards") or []: key = row.get("key", row["name"].lower()) @@ -275,6 +282,7 @@ def _render_html(snapshot: dict) -> str:
No public resources configured.
' + cards.append(f'''{esc(project['description'])}
{content}No public projects configured.
' if not cards else '' + return f'''Connected resources. Follow the source links for current records; listed resources do not establish quality or readiness.
+{empty}