PF research library · 8 min read
Complete Windows CMD guide — full r34 with bundled HF deployment
r34 documentation · hf-windows-deployment.md · Formatted reading copy
On this page
- 0. Extract and verify the full distribution
- 1. Copy the included deployment packages and create a session
- 2. Capture the installed state and pause the controller
- 3. Declare the actual work state
- 4. Create and upload the new private code repository
- 5. Copy and verify the state backup
- 6. Set the exact private-code pins
- 7. Prepare, inspect, then apply the controller
- 8. Restart once and verify recovery
- Resume the same session after closing CMD
- Validation scope and references
This guide uses only the corrected full distribution and its included
HF_DEPLOYMENT directory. No separate source or companion download is needed.
Run each command separately in Windows CMD and stop if a check fails.
The private-code candidate is:
a8ed105966694205649f5f1850258811363f110dca787cd7d6a0495cc2545ed2.
Its required installed predecessor is:
ebf1ba11f10f254fe30e46bcbf132ba18ba8cb8a0ad929068a36ddf4b66fd33c.
This is the existing reviewed Storage Recovery candidate, now packaged with
its deployment tools. Bundling does not change the application source.
0. Extract and verify the full distribution
Compare the downloaded .zip.xz with its accompanying .sha256 file using
certutil -hashfile "ACTUAL_ARCHIVE_PATH.zip.xz" SHA256. Extract the XZ layer,
then its ZIP into a fresh short directory such as C:\PF\r34-storage-recovery.
That directory must directly contain verify_distribution.py,
privileged-frame-simulation, and HF_DEPLOYMENT.
Set PF_R34_FULL_ROOT to your actual directory if different.
The preserved full release contains historical paths longer than 260 characters. Use an extractor and Windows/Python configuration that support long paths. A short extraction directory helps but does not remove that requirement. Do not skip, shorten, or rename historical paths; both verification steps must pass.
set "PF_R34_FULL_ROOT=C:\PF\r34-storage-recovery"
set "PF_HF_PYTHON=%USERPROFILE%\pf-hf-tools-r34-20261005\Scripts\python.exe"
cd /d "%PF_R34_FULL_ROOT%"
"%PF_HF_PYTHON%" -B verify_distribution.py
"%PF_HF_PYTHON%" -B privileged-frame-simulation\release_tools\package_r34_storage_incident_20261127.py verify --package
Require FULL_R34_DISTRIBUTION_VERIFIED, then status: verified with
package_checked: true. The outer check covers all included files, including
the deployment tools and guide. The inner check verifies the unchanged
corrected application release and its original qualification boundaries.
Neither command contacts HF.
1. Copy the included deployment packages and create a session
Keep the verified distribution unchanged. Copy its two bundled deployment folders together to a fresh external working directory. The command refuses an existing destination; never delete a previous deployment directory to repeat setup. An existing session must be resumed from its original location using the resume section below.
set "PF_R34_DEPLOY_PACKAGES=%USERPROFILE%\pf-r34-storage-recovery-packages-20261127"
"%PF_HF_PYTHON%" -B -c "import os,pathlib,shutil; e=os.environ; r=pathlib.Path(e['PF_R34_FULL_ROOT']).resolve(); d=pathlib.Path(e['PF_R34_DEPLOY_PACKAGES']).resolve(); assert d!=r and r not in d.parents,'Choose a directory outside the full distribution'; assert not d.exists(),'Destination exists; resume that session or choose a fresh directory'; shutil.copytree(r/'HF_DEPLOYMENT',d); print('BUNDLED_DEPLOYMENT_PACKAGES_COPIED',d)"
set "PF_HF_SOURCE_PACKAGE=%PF_R34_DEPLOY_PACKAGES%\PF_r34_HF_Full_Source_Storage_Recovery_20261127"
cd /d "%PF_HF_SOURCE_PACKAGE%"
"%PF_HF_PYTHON%" -B verify_package.py
Require HF_SOURCE_PACKAGE_VERIFIED. Then:
cd /d "%PF_R34_DEPLOY_PACKAGES%\PF_r34_HF_Storage_Recovery_Deployment_20261127"
"%PF_HF_PYTHON%" -B verify_companion.py
"%PF_HF_PYTHON%" -B setup_handoff.py --source-package "%PF_HF_SOURCE_PACKAGE%"
call session-settings.cmd
set "PF_HF_PRESERVE_ARGS="
"%PF_HF_CLI%" auth whoami
"%PF_HF_PYTHON%" -B deploy_release.py verify --bundle "%PF_HF_UPLOAD%"
Require DEPLOYMENT_COMPANION_VERIFIED, a successfully created or resumed
session, account ignalum, and local_bundle_verified for the corrected
candidate. If setup fails, do not call a missing or older session file.
Keep the copied source and companion folders and %PF_HF_WORK% in place.
The default work directory is outside both packages. These preparation and
verification commands make no HF changes; auth whoami reads your HF identity.
The remaining guarded deployment sequence is retained from the matching companion guide. Its embedded guide still documents the separately delivered Downloads layout; this outer guide supplies the bundled distribution paths.
2. Capture the installed state and pause the controller
If the workbench is available, pause research at a saved boundary and retain a
current evidence export. A controller already in RUNTIME_ERROR does not need
to be restarted to capture deployment metadata. It also does not establish
that all research/provider operations are settled.
"%PF_HF_CLI%" spaces info "%PF_HF_APP_REPO%" --expand sha,runtime
"%PF_HF_CLI%" spaces logs "%PF_HF_APP_REPO%" --tail 1000 > "%PF_HF_WORK%\before-upgrade.log"
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca snapshot
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca verify-runtime
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca pause
"%PF_HF_CLI%" spaces info "%PF_HF_APP_REPO%" --expand sha,runtime
Require SNAPSHOT_SAVED, CURRENT_CODE_AND_RUNTIME_VERIFIED, and observed
PAUSED. A source or runtime mismatch means the actual deployment differs
from the reviewed predecessor; retain the output for review rather than edit
pins, checksums or snapshots. The existing dependency image is verified and
retained. No runtime-image rebuild is part of this update.
3. Declare the actual work state
Choose exactly one mode based on current evidence.
Idle: only after confirming no unresolved research tasks, provider reservations or simulation attempts:
set "PF_HF_PRESERVE_ARGS=--idle-confirmed"
Unresolved work: declare all actual IDs together. Replace the example markers below; they are not literal IDs to paste:
set "PF_HF_PRESERVE_ARGS=--preserve-unresolved-operation discovery:ACTUAL_32_HEX_ID --preserve-unresolved-operation provider:ACTUAL_32_HEX_ID"
Use discovery:ID, investigation:ID, report:ID, or provider:ID for the
corresponding operations. Use --preserve-unresolved-attempt ACTUAL_PF_RUN_ID
for a simulation attempt. These are PF IDs, not HF Job IDs. Then run:
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca recovery-readiness %PF_HF_PRESERVE_ARGS%
Require FORWARD_RECOVERY_DECLARATIONS_RECORDED. This command is for the
nonempty unresolved declaration mode; do not call it with --idle-confirmed.
Retain the same complete declaration for apply. Unknown IDs, undecided work
state, or a crashed controller must not be converted into an idle assertion.
The helper checks the entire HF Jobs inventory in both modes and refuses
known queued/running or unrecognized Job states. It does not cancel Jobs or
settle uncertain AI-provider outcomes.
4. Create and upload the new private code repository
"%PF_HF_PYTHON%" -c "import os,truststore; truststore.inject_into_ssl(); from huggingface_hub import HfApi; a=HfApi(endpoint='https://huggingface.co',token=True); r=os.environ['PF_HF_CODE_REPO']; a.create_repo(repo_id=r,repo_type='space',space_sdk='docker',private=True,exist_ok=False); assert a.space_info(repo_id=r).private is True; print('PRIVATE_CODE_SPACE_CREATED',r)"
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca upload-code
call "%PF_HF_WORK%\code-revision.cmd"
"%PF_HF_PYTHON%" -B preflight_controller_access.py --system-ca
Require private_code_uploaded, verified source bytes, the corrected code
hash, and CONTROLLER_RESOURCE_PREFLIGHT_PASSED. At the hidden preflight
prompt, enter the controller's existing PF_HF_TOKEN, not an AI API key.
It is not saved; this metadata preflight submits no Job and cannot prove Jobs
creation permission or equality with the unreadable Space Secret value.
If repository creation reports 409, do not replace the repo or generate a new
session to bypass it. Inspect the intended repo and this same session first.
If an upload response is lost, run code-status before any further write:
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca code-status
5. Copy and verify the state backup
"%PF_HF_CLI%" buckets create "%PF_HF_OWNER%/%PF_HF_BACKUP_BUCKET_NAME%" --private
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca backup-ready
"%PF_HF_CLI%" cp "hf://buckets/%PF_HF_OWNER%/%PF_HF_BUCKET_NAME%/" "hf://buckets/%PF_HF_OWNER%/%PF_HF_BACKUP_BUCKET_NAME%/"
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca verify-backup
Require BACKUP_DESTINATION_READY and BACKUP MANIFEST VERIFIED.
The final verification requires a nonempty source, exact file metadata equality
between source and backup, the same source manifest before and after the check,
and a paused controller. Copied alone is not sufficient. Preserve the trailing
slashes in the copy command so it copies the source contents into the backup root.
The buckets must be in the same storage region.
If verification fails as it previously did with 33 missing files, remain in the
same session and keep the controller paused. A source that changed during the
check needs investigation of the other writer. For a stable source and partial
copy, rerun the same cp and verify-backup commands; do not rerun
backup-ready on a populated destination. Do not create a backup receipt by hand
or proceed to pins/apply after a failed verification. If the mismatch persists,
retain the diagnostic output for review.
6. Set the exact private-code pins
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca set-code-pins
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca configuration-check
Require NEW_CODE_PINS_SET_CONTROLLER_PAUSED and CONFIGURATION_PRESERVED.
Only the three intended code Variables change: PF_HF_CODE_REPO,
PF_HF_CODE_REVISION, and PF_HF_CODE_SHA256. Preserve the remaining Variables,
secret values/encryption keys, runtime image pins, hardware and data.
The helper compares secret names; HF does not expose existing secret values
for equality checking. Do not edit Secrets during the deployment.
7. Prepare, inspect, then apply the controller
Use the companion's deploy_release.py in the current directory. The original
source package's tools\deploy_release.py remains an offline verifier.
"%PF_HF_PYTHON%" -B deploy_release.py --system-ca prepare --bundle "%PF_HF_UPLOAD%" --space "%PF_HF_APP_REPO%" --state-dir "%PF_HF_DEPLOY_STATE%"
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca status
Require prepared_no_remote_changes before continuing:
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca apply %PF_HF_PRESERVE_ARGS%
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca status
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca configuration-check
"%PF_HF_CLI%" spaces info "%PF_HF_APP_REPO%" --expand sha,runtime
Require installed source bytes, retained configuration, and observed PAUSED.
The expected status before restart is patch_installed_runtime_unconfirmed.
CONTROLLER_NOT_PREPARED means the prepare step has not completed; it is not
permission to apply. If a commit response is lost, retain the same journal and
inspect status. Do not blindly repeat apply or create a new session.
8. Restart once and verify recovery
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca restart
"%PF_HF_CLI%" spaces info "%PF_HF_APP_REPO%" --expand sha,runtime
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca restart-status
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca status
"%PF_HF_CLI%" spaces logs "%PF_HF_APP_REPO%" --tail 1000 > "%PF_HF_WORK%\after-upgrade.log"
RESTART_REQUEST_ACCEPTED_RUNTIME_UNCONFIRMED acknowledges the restart request.
It does not mean the application is ready. While building or recovering, repeat
read-only spaces info, restart-status, status, and log commands; do not
repeatedly request restart. Require RESTART_RUNNING_REVISION_VERIFIED /
patch_installed_running for the intended revision, then open the workbench.
If HF does not expose a running revision, the helper must retain an unconfirmed
status even if HF says RUNNING.
Confirm the recovery page completes and existing projects, task IDs, saved checkpoints, allowances, scenario revisions and evidence remain available. Paused work must remain paused. Previously running work may continue under its existing saved authorization; deployment grants no new allowance. Retain logs and evidence if recovery stops. No code-only rollback or manual state rewrite is prescribed by this companion.
Resume the same session after closing CMD
set "PF_R34_DEPLOY_PACKAGES=%USERPROFILE%\pf-r34-storage-recovery-packages-20261127"
cd /d "%PF_R34_DEPLOY_PACKAGES%\PF_r34_HF_Storage_Recovery_Deployment_20261127"
call session-settings.cmd
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca code-status
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca status
"%PF_HF_PYTHON%" -B handoff_checks.py --system-ca restart-status
If you chose a different working directory, use that exact directory in the
resume command. Do not copy the packages again or move a prepared session.
Restore the exact PF_HF_PRESERVE_ARGS declaration before apply. The session
restores a verified code revision when its receipt exists; it does not infer
whether application work is idle. Retain all previous and current session
records and backup destinations.
Validation scope and references
The companion's validation report lists local tests using fake HF APIs and the actual verified payload. No live HF mutation, Job submission, production recovery test or secret-value comparison was performed during its creation. Readiness is checked on your deployment after installation.
Official API references reviewed for this procedure: