Implement researched Guix package outcome for #386: [Guix packaging] Hack #692

Closed
opened 2026-09-06 12:42:07 +00:00 by htayj · 3 comments
htayj commented 2026-09-06 12:42:07 +00:00 (Migrated from github.com)

Context

This delivery ticket was created from research issue #386 ([Guix packaging] Hack).

The host-validated research finding follows:

Canonical upstream is Andries Brouwer's authoritative CWI Hack page, https://homepages.cwi.nl/~aeb/games/hack/hack.html, which identifies Hack 1.0.3 as the last distributed version (23-Jul-1985) and links the complete source archive https://homepages.cwi.nl/~aeb/games/hack/hack-1.0.3.tar.gz. There is no maintained upstream VCS repository or commit; pin the immutable 1.0.3 archive itself: SHA-256 688534e776acfe620ea9e24822bea8b0b4bbe8ec2c2f3c74c8db89b51c7bcc30 (Guix nix-base32 0c6cgcfbb2fvr1s3qbrcxklbpd5hm2z24j72m4765zmcfvkk91b8). The archive is one origin with 57 C files, 20 headers, data/help/hh/rumors, hack.6, READ_ME, and the historical build files; no submodules, registries, fonts, tiles, sounds, or separately fetched dependencies. The CWI page grants exact three-clause BSD terms for CWI's 1985 contributions and reproduces Jay Fenlason's exact three-clause BSD grant for his code. The archive's COPYRIGHT and COPYRIGHT-JF notices must both be retained in installed documentation; install the same-origin data/help/rumors/man documentation only with those notices, omit unverified third-party assets, and omit Original_READ_ME unless its documentation coverage is explicitly accepted. The source is legally redistributable but its 1985 Makefile is not directly modern-buildable: it assumes cc, /lib/crt0.o, ld, termlib, and lint. Implement with gnu-build-system, a target C compiler plus make, and ncurses/terminfo (termcap compatibility); replace the obsolete final link and omit lint, generate hack.onames.h with makedefs, and use serialized deterministic C compilation as needed for K&R-era code. No language-ecosystem closure or network access is required. The installed GNU Guix search for ^hack$ was empty, and the local channel/audit search found no package named hack or hack.scm; acehack, dhack, dnethack, grunthack, and flaghack are distinct upstream variants, so this is not a duplicate. Package identity should be hack in tay/packages/hack.scm. The wrapper must disable the source's MAIL and shell-escape behavior at build time, keep all mutable files (record, perm/locks, bones, save, news if created) below ${XDG_DATA_HOME:-$HOME/.local/share}/hack, expose immutable data/help/hh/rumors from the store without store writes, set TERMINFO_DIRS to the ncurses input, and pass -d to the private state directory. Add a --guix-smoke wrapper mode that runs the real terminal game in a bounded PTY with deterministic input: start a fresh game as a fixed player, make at least one movement/turn, save, exit, restore the save, then verify the restored game screen and that every created path remains under the fresh XDG state directory; emit exactly the single-line marker hack guix smoke passed on stdout. Acceptance must include guix lint -L . hack, guix build -L . --no-grafts --no-substitutes hack, upstream/available tests or an explicit no-test rationale, --check reproducibility, and the fresh HOME/XDG smoke proof with the PNG artifact path below. Research did not claim a Guix build proof because the trusted phase forbids daemon/toolchain use.

Acceptance criteria

  • Implement the viable package change identified in the host-validated research finding.
  • Preserve Guix source provenance, licensing, and deterministic build requirements recorded in the finding.
  • Add and pass a package-specific safe smoke proof using isolated HOME/XDG state before closure.

Runtime evidence contract

Implementation workflow: guix-package-quality-gates
Reviewed contract file: .goocastle/runtime-evidence-contracts.json
Required proof phase: safe-package-proof; screenshot phase: runtime-screenshot
Evidence adapter: github-issue-comment
Copy this reviewed contract into the named file before running the package proof workflow.

{
  "version": 1,
  "contracts": [
    {
      "issueNumber": 692,
      "packageName": "hack",
      "packageModulePath": "tay/packages/hack.scm",
      "artifactPath": ".goocastle/evidence/issue-692.png",
      "runtime": {
        "executable": "hack",
        "invocation": {
          "file": "hack",
          "args": [
            "--guix-smoke"
          ]
        },
        "successMarker": "hack guix smoke passed"
      }
    }
  ]
}

Imported from GitHub issue/PR. Originally posted by htayj on 2026-09-06T12:42:07Z.

<!-- goocastle-implementation-ticket:sequential-reviewer:386:1:implementation-ready --> ## Context This delivery ticket was created from research issue #386 ([Guix packaging] Hack). The host-validated research finding follows: Canonical upstream is Andries Brouwer's authoritative CWI Hack page, https://homepages.cwi.nl/~aeb/games/hack/hack.html, which identifies Hack 1.0.3 as the last distributed version (23-Jul-1985) and links the complete source archive https://homepages.cwi.nl/~aeb/games/hack/hack-1.0.3.tar.gz. There is no maintained upstream VCS repository or commit; pin the immutable 1.0.3 archive itself: SHA-256 688534e776acfe620ea9e24822bea8b0b4bbe8ec2c2f3c74c8db89b51c7bcc30 (Guix nix-base32 0c6cgcfbb2fvr1s3qbrcxklbpd5hm2z24j72m4765zmcfvkk91b8). The archive is one origin with 57 C files, 20 headers, data/help/hh/rumors, hack.6, READ_ME, and the historical build files; no submodules, registries, fonts, tiles, sounds, or separately fetched dependencies. The CWI page grants exact three-clause BSD terms for CWI's 1985 contributions and reproduces Jay Fenlason's exact three-clause BSD grant for his code. The archive's COPYRIGHT and COPYRIGHT-JF notices must both be retained in installed documentation; install the same-origin data/help/rumors/man documentation only with those notices, omit unverified third-party assets, and omit Original_READ_ME unless its documentation coverage is explicitly accepted. The source is legally redistributable but its 1985 Makefile is not directly modern-buildable: it assumes cc, /lib/crt0.o, ld, termlib, and lint. Implement with gnu-build-system, a target C compiler plus make, and ncurses/terminfo (termcap compatibility); replace the obsolete final link and omit lint, generate hack.onames.h with makedefs, and use serialized deterministic C compilation as needed for K&R-era code. No language-ecosystem closure or network access is required. The installed GNU Guix search for ^hack$ was empty, and the local channel/audit search found no package named hack or hack.scm; acehack, dhack, dnethack, grunthack, and flaghack are distinct upstream variants, so this is not a duplicate. Package identity should be hack in tay/packages/hack.scm. The wrapper must disable the source's MAIL and shell-escape behavior at build time, keep all mutable files (record, perm/locks, bones, save, news if created) below ${XDG_DATA_HOME:-$HOME/.local/share}/hack, expose immutable data/help/hh/rumors from the store without store writes, set TERMINFO_DIRS to the ncurses input, and pass -d to the private state directory. Add a --guix-smoke wrapper mode that runs the real terminal game in a bounded PTY with deterministic input: start a fresh game as a fixed player, make at least one movement/turn, save, exit, restore the save, then verify the restored game screen and that every created path remains under the fresh XDG state directory; emit exactly the single-line marker hack guix smoke passed on stdout. Acceptance must include guix lint -L . hack, guix build -L . --no-grafts --no-substitutes hack, upstream/available tests or an explicit no-test rationale, --check reproducibility, and the fresh HOME/XDG smoke proof with the PNG artifact path below. Research did not claim a Guix build proof because the trusted phase forbids daemon/toolchain use. ## Acceptance criteria - Implement the viable package change identified in the host-validated research finding. - Preserve Guix source provenance, licensing, and deterministic build requirements recorded in the finding. - Add and pass a package-specific safe smoke proof using isolated HOME/XDG state before closure. <!-- goocastle-runtime-evidence-contract --> ## Runtime evidence contract Implementation workflow: `guix-package-quality-gates` Reviewed contract file: `.goocastle/runtime-evidence-contracts.json` Required proof phase: `safe-package-proof`; screenshot phase: `runtime-screenshot` Evidence adapter: `github-issue-comment` Copy this reviewed contract into the named file before running the package proof workflow. ```json { "version": 1, "contracts": [ { "issueNumber": 692, "packageName": "hack", "packageModulePath": "tay/packages/hack.scm", "artifactPath": ".goocastle/evidence/issue-692.png", "runtime": { "executable": "hack", "invocation": { "file": "hack", "args": [ "--guix-smoke" ] }, "successMarker": "hack guix smoke passed" } } ] } ``` <!-- goocastle-runtime-evidence-contract-end --> --- Imported from [GitHub issue/PR](https://github.com/htayj/guix-channel/issues/692). Originally posted by [htayj](https://github.com/htayj) on 2026-09-06T12:42:07Z.
htayj commented 2026-09-06 14:01:59 +00:00 (Migrated from github.com)

Goocastle blocked this ticket after the bounded repair budget was exhausted for the required command gate.
The failure receipt and task branch provenance remain preserved; inspect the branch and repair the failing gate before retrying.

Bounded failure evidence:
Failed command: node /opt/goocastle/bin/guix-package-proof.mjs '--package-name' hack '--module-path' tay/packages/hack.scm '--runtime-json' '{"executable":"hack","invocation":{"file":"hack","args":["--guix-smoke"]},"successMarker":"hack guix smoke passed"}'
Exit status: 1
Final failure lines:
[stderr] error: in phase 'build': uncaught exception:
[stderr] %exception #<&invoke-error program: "make" arguments: ("CC=gcc" "CFLAGS=-O2 -g0 -std=gnu89 -fcommon -D_DEFAULT_SOURCE" "TERMLIB=-ltinfo" "hack") exit-status: 2 term-signal: #f stop-signal: #f>
[stderr] phase build' failed after 2.[REDACTED] seconds [stderr] command "make" "CC=gcc" "CFLAGS=-O2 -g0 -std=gnu89 -fcommon -D_DEFAULT_SOURCE" "TERMLIB=-ltinfo" "hack" failed with status 2 [stderr] builder for /gnu/store/rbwsm6phjib6x6rw8shvxanhpdmpz6a7-hack-[REDACTED].0.3.drv' failed with exit code [REDACTED]
[stderr] build of /gnu/store/rbwsm6phjib6x6rw8shvxanhpdmpz6a7-hack-[REDACTED].0.3.drv failed
[stderr] guix build: error: build of `/gnu/store/rbwsm6phjib6x6rw8shvxanhpdmpz6a7-hack-[REDACTED].0.3.drv' failed
[stderr] guix exited with code [REDACTED]
[earlier or oversized output omitted]


Imported from GitHub comment. Originally posted by htayj on 2026-09-06T14:01:59Z.

<!-- goocastle-repair-blocked:692:safe-package-proof --> Goocastle blocked this ticket after the bounded repair budget was exhausted for the required command gate. The failure receipt and task branch provenance remain preserved; inspect the branch and repair the failing gate before retrying. Bounded failure evidence: Failed command: node /opt/goocastle/bin/guix-package-proof.mjs '--package-name' hack '--module-path' tay/packages/hack.scm '--runtime-json' '{"executable":"hack","invocation":{"file":"hack","args":["--guix-smoke"]},"successMarker":"hack guix smoke passed"}' Exit status: 1 Final failure lines: [stderr] error: in phase 'build': uncaught exception: [stderr] %exception #<&invoke-error program: "make" arguments: ("CC=gcc" "CFLAGS=-O2 -g0 -std=gnu89 -fcommon -D_DEFAULT_SOURCE" "TERMLIB=-ltinfo" "hack") exit-status: 2 term-signal: #f stop-signal: #f> [stderr] phase `build' failed after 2.[REDACTED] seconds [stderr] command "make" "CC=gcc" "CFLAGS=-O2 -g0 -std=gnu89 -fcommon -D_DEFAULT_SOURCE" "TERMLIB=-ltinfo" "hack" failed with status 2 [stderr] builder for `/gnu/store/rbwsm6phjib6x6rw8shvxanhpdmpz6a7-hack-[REDACTED].0.3.drv' failed with exit code [REDACTED] [stderr] build of /gnu/store/rbwsm6phjib6x6rw8shvxanhpdmpz6a7-hack-[REDACTED].0.3.drv failed [stderr] guix build: error: build of `/gnu/store/rbwsm6phjib6x6rw8shvxanhpdmpz6a7-hack-[REDACTED].0.3.drv' failed [stderr] guix exited with code [REDACTED] [earlier or oversized output omitted] --- Imported from [GitHub comment](https://github.com/htayj/guix-channel/issues/692#issuecomment-5559725767). Originally posted by [htayj](https://github.com/htayj) on 2026-09-06T14:01:59Z.
htayj commented 2026-09-06 14:54:18 +00:00 (Migrated from github.com)

Goocastle verified runtime evidence.

Runtime screenshot

Runtime receipt
  • Package: hack
  • Safe package proof phase: safe-package-proof
  • Safe package proof argv: ["node","/opt/goocastle/bin/guix-package-proof.mjs","--package-name","hack","--module-path","tay/packages/hack.scm","--runtime-json","{&quot;executable&quot;:&quot;hack&quot;,&quot;invocation&quot;:{&quot;file&quot;:&quot;hack&quot;,&quot;args&quot;:[&quot;--guix-smoke&quot;]},&quot;successMarker&quot;:&quot;hack guix smoke passed&quot;}"]
  • Screenshot phase: runtime-screenshot
  • Screenshot argv: ["sh",".goocastle/capture-guix-package-screenshot.sh"]
  • Runtime executable (Guix store/profile): /gnu/store/2b2dvgj000mfi96yglvzy96dfj8zlnxy-hack-1.0.3/bin/hack
  • Runtime invocation: ["/gnu/store/2b2dvgj000mfi96yglvzy96dfj8zlnxy-hack-1.0.3/bin/hack","--guix-smoke"]
  • Expected runtime invocation: ["hack","--guix-smoke"]
  • Expected runtime marker: hack guix smoke passed
  • Per-issue runtime contract: .goocastle/runtime-evidence-contracts.json (issue #692, SHA-256 74d69dc1184499a69633e190476c6b2b5616eaf98254546168eb646246d61188)
  • Artifact path: .goocastle/evidence/issue-692.png
  • Artifact SHA-256: 2024728eea66a3555065d03dfcfcd3880a5a76388b45dc61f3d09f4b4a86e7d8
  • Artifact commit: 4691bb04f125e5473e269ded1d59b58aba75a000
  • Artifact size/format: 33324 bytes / png

Imported from GitHub comment. Originally posted by htayj on 2026-09-06T14:54:18Z.

<!-- goocastle-runtime-evidence:sequential-reviewer:692:1:2024728eea66a3555065d03dfcfcd3880a5a76388b45dc61f3d09f4b4a86e7d8 --> Goocastle verified runtime evidence. ![Runtime screenshot](https://github.com/htayj/guix-channel/blob/4691bb04f125e5473e269ded1d59b58aba75a000/.goocastle/evidence/issue-692.png?raw=1) <details><summary>Runtime receipt</summary> - Package: <code>hack</code> - Safe package proof phase: <code>safe-package-proof</code> - Safe package proof argv: <code>[&quot;node&quot;,&quot;/opt/goocastle/bin/guix-package-proof.mjs&quot;,&quot;--package-name&quot;,&quot;hack&quot;,&quot;--module-path&quot;,&quot;tay/packages/hack.scm&quot;,&quot;--runtime-json&quot;,&quot;{\&quot;executable\&quot;:\&quot;hack\&quot;,\&quot;invocation\&quot;:{\&quot;file\&quot;:\&quot;hack\&quot;,\&quot;args\&quot;:[\&quot;--guix-smoke\&quot;]},\&quot;successMarker\&quot;:\&quot;hack guix smoke passed\&quot;}&quot;]</code> - Screenshot phase: <code>runtime-screenshot</code> - Screenshot argv: <code>[&quot;sh&quot;,&quot;.goocastle/capture-guix-package-screenshot.sh&quot;]</code> - Runtime executable (Guix store/profile): <code>/gnu/store/2b2dvgj000mfi96yglvzy96dfj8zlnxy-hack-1.0.3/bin/hack</code> - Runtime invocation: <code>[&quot;/gnu/store/2b2dvgj000mfi96yglvzy96dfj8zlnxy-hack-1.0.3/bin/hack&quot;,&quot;--guix-smoke&quot;]</code> - Expected runtime invocation: <code>[&quot;hack&quot;,&quot;--guix-smoke&quot;]</code> - Expected runtime marker: <code>hack guix smoke passed</code> - Per-issue runtime contract: <code>.goocastle/runtime-evidence-contracts.json (issue #692, SHA-256 74d69dc1184499a69633e190476c6b2b5616eaf98254546168eb646246d61188)</code> - Artifact path: <code>.goocastle/evidence/issue-692.png</code> - Artifact SHA-256: <code>2024728eea66a3555065d03dfcfcd3880a5a76388b45dc61f3d09f4b4a86e7d8</code> - Artifact commit: <code>4691bb04f125e5473e269ded1d59b58aba75a000</code> - Artifact size/format: <code>33324 bytes / png</code> </details> --- Imported from [GitHub comment](https://github.com/htayj/guix-channel/issues/692#issuecomment-5560041319). Originally posted by [htayj](https://github.com/htayj) on 2026-09-06T14:54:18Z.
htayj commented 2026-09-06 14:54:23 +00:00 (Migrated from github.com)

Completed by Goocastle


Imported from GitHub comment. Originally posted by htayj on 2026-09-06T14:54:23Z.

Completed by Goocastle --- Imported from [GitHub comment](https://github.com/htayj/guix-channel/issues/692#issuecomment-5560041718). Originally posted by [htayj](https://github.com/htayj) on 2026-09-06T14:54:23Z.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tay/guix-channel#692
No description provided.