Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: CI

on:
push:
pull_request:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
test:
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/linux-image.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
name: Linux development image

on:
pull_request:
paths:
- 'packaging/**'
- 'build/build_iso.sh'
- 'phishell/**'
- 'phios/**'
- 'pyproject.toml'
- '.github/workflows/linux-image.yml'
workflow_call:
workflow_dispatch:

permissions:
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/os-release-candidate.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
name: Fixture-free OS candidate (unpublished)

on:
pull_request:
paths:
- 'packaging/**'
- 'phios/**'
- 'phishell/**'
- 'pyproject.toml'
- 'build/build_iso.sh'
- '.github/workflows/os-release-candidate.yml'
workflow_call:
workflow_dispatch:

permissions:
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/phishell.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
name: PhiShell

on:
pull_request:
paths:
- "phishell/**"
- "docs/PHISHELL_*.md"
- ".github/workflows/phishell.yml"
push:
branches:
- main
paths:
- "phishell/**"
- "docs/PHISHELL_*.md"
- ".github/workflows/phishell.yml"
workflow_call:
workflow_dispatch:

permissions:
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/release-qualification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: PhiOS qualification

on:
pull_request:
push:
branches: [main]
tags: ['phios-linux-v*']
workflow_dispatch:

permissions:
contents: read

concurrency:
group: phios-qualification-${{ github.ref }}
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
image: ${{ steps.scope.outputs.image }}
ui: ${{ steps.scope.outputs.ui }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
persist-credentials: false
- id: scope
name: Determine required qualification from the complete local diff
run: python3 scripts/os_ci_gate.py plan

python-tests:
needs: changes
uses: ./.github/workflows/ci.yml

phishell:
needs: changes
if: ${{ needs.changes.outputs.ui == 'true' }}
uses: ./.github/workflows/phishell.yml

normal-image:
needs: changes
if: ${{ needs.changes.outputs.image == 'true' }}
uses: ./.github/workflows/os-release-candidate.yml

qa-image:
needs: changes
if: ${{ needs.changes.outputs.image == 'true' }}
uses: ./.github/workflows/linux-image.yml

release-gate:
name: release-gate
if: ${{ always() }}
needs: [changes, python-tests, phishell, normal-image, qa-image]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Require actual success for every requested job
env:
PHIOS_CI_NEEDS: ${{ toJSON(needs) }}
run: python3 scripts/os_ci_gate.py check
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ platform, memory/ledger system, and constrained agent runtime built around one r

The project is under active development and should be treated as **alpha software**.

The Python package release is separate from the Linux OS effort. The Linux target is an x86_64 UEFI Arch-based Wayfire/PhiShell development preview. Installation, whole-OS recovery, Secure Boot, hardware support and Linux desktop effects are not yet qualified. See [the OS release contract](docs/os/RELEASE_CONTRACT.md) and [implementation status](docs/os/IMPLEMENTATION_STATUS.md).
The Python package release is separate from the Linux OS effort. The Linux target
is an unpublished x86_64 UEFI Arch-based Wayfire/PhiShell development preview.
The exact normal candidate passed VM live/installed boot, persistent data,
matched OS recovery and one restricted Linux proof effect. A separate QA image
passed bounded signed-package update/interruption tests. Physical hardware,
the actual final signed transition, source/license delivery and public release
remain open; Secure Boot is unsupported. See the [OS release contract](docs/os/RELEASE_CONTRACT.md),
[exact evidence](docs/os/IMPLEMENTATION_STATUS.md) and [release handoff](docs/os/RELEASE_HANDOFF.md).

## What PhiOS is

Expand Down
39 changes: 37 additions & 2 deletions docs/os/BUILD_AND_QUALIFY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Build and qualify the Linux development preview

Use the `Linux development image` pull-request workflow. It builds in a pinned
Use the always-triggered `PhiOS qualification` workflow. Its reusable
`Linux development image` job builds the separate QA artifact in a pinned
x86_64 Arch container, downgrades/synchronizes to the fixed Arch repository
snapshot in `packaging/linux/release.json`, checks the Archiso package version,
and builds the Python and UI packages from a hashed archive of the exact source
Expand Down Expand Up @@ -64,4 +65,38 @@ A fixture pass is evidence for the checks it performs. Review the screenshot
and session behavior. It does not prove installation, persisted receipts,
crash recovery, whole-OS updates, hardware compatibility or a Linux effect
executor. Those remain explicit gates in RELEASE_CONTRACT.md. CI never tags,
signs, publishes or automatically promotes this candidate.
signs, publishes or automatically promotes this candidate. The later installed
and normal-image gates have their own scopes and receipts in IMPLEMENTATION_STATUS.md.

## Always-reported qualification gate

`release-qualification.yml` runs for every pull request, every main push,
OS `phios-linux-v*` tag and manual invocation. It calls the existing Python,
PhiShell, normal image and QA image workflows from the same source revision;
it does not poll or borrow another commit's successful runs. The called
workflows retain independent manual entrypoints and their existing tests and
artifact retention. Automatic calls are centralized to avoid duplicate builds.

Python tests, installed wheel, native vector and ledger-report checks always
run. Only a complete observed documentation-only PR may omit the expensive
image jobs. PhiShell contract docs still request UI checks. Unknown files,
deleted runtime files, build/test/workflow inputs, unreadable diff, main pushes,
OS tags and manual runs require both images and UI. The classifier uses the
complete local Git trees, including deletions, without an API pagination or
300-file workflow-path cutoff.

The final job is named **`release-gate`**, with `if: always()`. It fails when
scope determination fails, any required result is missing/failed/cancelled/
skipped, or scope outputs disagree. A skipped image is acceptable only when
explicitly unrequested for that documentation-only PR; this is not a new image
qualification. The job reports `release_ready: false` and no publication authority.
All jobs have read-only contents permissions and inherit no release secrets.

After reviewing this change and observing a successful run, the maintainer
should configure **`release-gate`** from GitHub Actions as the required status
on protected main and the applicable release rules. Require current-branch
checks and review, restrict bypass/force push/deletion and protect the OS tag
namespace as appropriate to the chosen release ownership. Those repository
settings are not changed by a workflow commit. A green aggregate does not
replace hardware evidence, authentic signing, final transition qualification,
source/license delivery or explicit release authorization.
3 changes: 3 additions & 0 deletions docs/os/RELEASE_ARTIFACTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ All generated reports remain `release_ready: false`; they do not grant
execution, signing, adapter-promotion or publication authority. Main/release
branch protection and required-check settings have not been changed by this
candidate workflow. Protecting them remains a maintainer repository setting.
The always-reported `release-gate` aggregates the same-source Python/UI/normal/
QA jobs; see BUILD_AND_QUALIFY.md for its required-status configuration and
explicit documentation-only scope. It cannot attest to hardware or sign/publish.

The builder also captures actual Rollup chunk participants before npm pruning,
including Vite-generated runtime helpers. Bundled supplier metadata and license
Expand Down
3 changes: 3 additions & 0 deletions docs/os/RELEASE_HANDOFF.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Review and merge only in stack order after assessing each stated boundary:
| [276](https://github.com/MichaelWave369/PhiOS/pull/276) | Restricted Linux proof broker, hardware handoff and bundled frontend inventory |
| [277](https://github.com/MichaelWave369/PhiOS/pull/277) | Exact normal-image installed/recovery gate and explicit serial password login |

Review the follow-on always-reported qualification gate after this stack; its
normal and QA jobs reuse the existing exact-image procedures. See
BUILD_AND_QUALIFY.md for the `release-gate` required-status handoff.
Review source and tests, not just a green check. Main and OS release-tag protection
still require maintainer configuration. Keep publication separate from the
existing Python `v*`/PyPI workflow. Evidence never promotes an adapter, enrolls a
Expand Down
106 changes: 106 additions & 0 deletions scripts/os_ci_gate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
"""Always-reported CI aggregation; a passing result is not release authority."""
from __future__ import annotations

import argparse
import json
import os
import re
import subprocess
from pathlib import Path
from typing import Any

JOBS = ('changes', 'python-tests', 'phishell', 'normal-image', 'qa-image')
SHA = re.compile(r'[0-9a-f]{40}')


def documentation(path: str) -> bool:
parts = path.split('/')
if any(part in ('', '.', '..') for part in parts) or '\\' in path:
return False
if len(parts) == 1:
return path.endswith('.md')
if parts[0] == 'docs' and path.endswith('.md'):
return True
return path.startswith('docs/os/evidence/') and path.endswith('.json')


def plan(event_name: str, paths: list[str] | None) -> dict[str, str]:
# Every final main push, OS tag and manual run exercises both exact images.
# Only an observed documentation-only PR can omit their expensive jobs.
image = event_name != 'pull_request' or not paths or any(not documentation(p) for p in paths)
ui = image or any(p.startswith('docs/PHISHELL_') for p in paths or [])
return {'image': str(image).lower(), 'ui': str(ui).lower()}


def changed_paths(event: dict[str, Any], root: Path) -> list[str] | None:
request = event.get('pull_request')
if not isinstance(request, dict):
raise ValueError('missing pull-request context')
base = request.get('base', {}).get('sha')
head = request.get('head', {}).get('sha')
if not isinstance(base, str) or not isinstance(head, str) or not SHA.fullmatch(base) or not SHA.fullmatch(head):
raise ValueError('invalid diff identities')
try:
# Two complete trees include deletions and changes introduced by a moved
# base. No API pagination/300-file path filter or rename omission applies.
data = subprocess.check_output(
['git', 'diff', '--no-ext-diff', '--no-renames', '--name-only', '-z', base, head, '--'],
cwd=root,
)
if data and not data.endswith(b'\0'):
raise ValueError('incomplete changed-path output')
return [p.decode('utf-8') for p in data.split(b'\0') if p]
except (subprocess.CalledProcessError, UnicodeDecodeError):
# An unavailable/unreadable diff requires full image qualification.
return None


def verify(needs: dict[str, Any]) -> dict[str, str]:
if set(needs) != set(JOBS) or any(not isinstance(needs[k], dict) for k in JOBS):
raise ValueError('incomplete required job results')
if needs['changes'].get('result') != 'success':
raise ValueError('qualification scope did not succeed')
scope = needs['changes'].get('outputs')
if not isinstance(scope, dict) or set(scope) != {'image', 'ui'} or any(v not in ('true', 'false') for v in scope.values()):
raise ValueError('invalid qualification scope outputs')
if scope['image'] == 'true' and scope['ui'] != 'true':
raise ValueError('image qualification requires UI qualification')
expected = {'changes': 'success', 'python-tests': 'success',
'phishell': 'success' if scope['ui'] == 'true' else 'skipped',
'normal-image': 'success' if scope['image'] == 'true' else 'skipped',
'qa-image': 'success' if scope['image'] == 'true' else 'skipped'}
for job, result in expected.items():
if needs[job].get('result') != result:
raise ValueError(f'required qualification result held: {job}')
return expected


def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('command', choices=('plan', 'check'))
args = parser.parse_args()
try:
if args.command == 'plan':
event_name = os.environ['GITHUB_EVENT_NAME']
paths = None
if event_name == 'pull_request':
event = json.loads(Path(os.environ['GITHUB_EVENT_PATH']).read_text())
paths = changed_paths(event, Path.cwd())
scope = plan(event_name, paths)
with Path(os.environ['GITHUB_OUTPUT']).open('a') as stream:
for key, value in scope.items():
stream.write(f'{key}={value}\n')
print(json.dumps({'required': scope, 'complete_diff_observed': paths is not None}, sort_keys=True))
else:
results = verify(json.loads(os.environ['PHIOS_CI_NEEDS']))
print(json.dumps({'schema_version': 'phios.ci-qualification.v1',
'source_commit': os.environ['GITHUB_SHA'], 'job_results': results,
'release_ready': False, 'publication_authority': False}, sort_keys=True))
return 0
except (KeyError, OSError, ValueError, TypeError, AttributeError) as exc:
print(f'::error::PhiOS qualification held: {exc}')
return 1


if __name__ == '__main__':
raise SystemExit(main())
Loading
Loading