�
�f�j�% � �� � d Z ddlZddlZddlZddlZddlmZ ddlZddlZddl Z ej
d� � Zd� Zd� Z
d� Zd� Zd � Zd
� Zd� Zd� Zd
� Zd� Zd� Zedk r e� � dS dS )uZ Build the certified framework manifest (`framework.json`) for a release.
The manifest records the worktree's lockfile hash, the scaffold table the root manifest's `[package.metadata.waterui]` declares, and
that metadata table verbatim. A scaffold package whose
`[workspace.dependencies]` requirement is a git pin (`git` + `rev`) has no
registry release the stable channel could resolve, so a `stable` manifest
withholds its entries from `scaffold` and records the pin under
`experimental-packages` instead; `nightly` carries it in `scaffold` like any
other package. The Rust side derives exactly the same tables for a tree
(`framework_scaffold` in
https://github.com/water-rs/cli/blob/dev/src/project_model/framework.rs) — the
two must not drift, so this script never reads anything from the CLI.
`stable` certifies the framework release tag release-plz published
(`v<version>`), or — under release preflight, where the release does not
exist yet — the candidate revision it will publish. The named revision is
checked out so every recorded fact is read from the released tree.
`nightly` certifies the `dev` revision a green full-matrix run tested, as
the immutable `nightly-<date>-<sha12>` tag `nightly.yml` publishes. It
refuses a revision that is already certified or that does not advance the
newest certification, so the certified line only moves forward.
� N)�Pathznightly-\d{8}-[0-9a-f]{12}c �X � t j dg| �d�� � � � � S )N�gitT��text)�
subprocess�check_output�strip)�argss �L/Users/lexoliu/Coding/waterui-wt-winui/.github/scripts/framework_manifest.pyr r ) s* � ��"�E�>�D�>��=�=�=�C�C�E�E�E� c � � t d� � } t | � � t j | � � � � � � � � iS )z>The dependency lock the CLI verifies a certified tree against.z
Cargo.lock)r �str�hashlib�sha256�
read_bytes� hexdigest)�locks r �lockfile_hashesr - s@ � �����D���I�I�w�~�d�o�o�&7�&7�8�8�B�B�D�D�E�Er
c �( � | d d d }| d d }i }|d D ]�}|| }t |t � � r|n|d ||� d�<