1- # ** ARK Locking Specification v1.0 **
1+ # ** ARK Locking Specification v1.1 **
22
33This document defines the architecture and behavior of the build locking mechanism, ensuring reproducibility across environments.
44
@@ -44,6 +44,7 @@ project:
4444 version : 1.0.0 # Copied from project.version
4545 entry : src/main.py # Copied from project.entry
4646 git_commit : sha256:abc123... # Snapshot of current git commit
47+ git_branch : main # Current git branch name
4748
4849workspace :
4950 exclude_patterns : # Copied from build.exclude (legacy support)
@@ -70,7 +71,7 @@ engine:
7071platform :
7172 os : windows # sys.platform snapshot
7273 arch : x86_64 # machine architecture snapshot
73- python_version : 3.11.9 # runtime version snapshot
74+ python_version : 3.11.9 # exact build interpreter version
7475
7576dependencies : # Full 'pip freeze' snapshot
7677 PySide6 : 6.7.2
@@ -87,10 +88,13 @@ workspace_hash: sha256:4a5b6c7d8e9f0a1b2c3d...
8788When rebuilding from a lock, ARK performs a "Strict Rebuild" :
8889
89901. **Read Lock** : Loads the specified lock file (ignores live `ark.yml`).
90- 2. **Verify Environment** : (Optional/Informational) compares the current environment against the lock metadata.
91- 3. **Build** : Passes the locked data directly to the engine via the **BuildContext**.
92- 4. **Shadow Lock Generation** : During the rebuild, ARK generates a *new* lock based on the current live state.
93- 5. **Comparison** : The used lock and the generated shadow lock are compared.
91+ 2. **Verify Git Alignment** : Checks if current `git_branch` and `git_commit` match the lock.
92+ - **Linux**: ARK offers to perform automatic `git checkout` (branch then commit).
93+ - **Windows**: ARK displays the exact manual commands to run.
94+ 3. **Verify Environment** : ARK captures the current Python version and environment.
95+ 4. **Build** : Passes the locked data directly to the engine via the **BuildContext**.
96+ 5. **Shadow Lock Generation** : During the rebuild, ARK generates a *new* lock based on the current live state.
97+ 6. **Comparison** : The used lock and the generated shadow lock are compared.
9498 - **Identical**: Build successful, environment is consistent.
9599 - **Mismatch**: ARK issues a warning (stored in `.ark/cache/rebuild.lock/`).
96100
@@ -105,4 +109,4 @@ When rebuilding from a lock, ARK performs a "Strict Rebuild":
105109- **L5**: The lock is the **sole source of truth** during a `--lock` build.
106110
107111---
108- *End of Specification v1.0 *
112+ *End of Specification v1.1 *
0 commit comments