diff --git a/remote.md b/remote.md index df86a0d..36e5487 100644 --- a/remote.md +++ b/remote.md @@ -975,6 +975,19 @@ suites (private D-Bus), the Remote race suite and `make check` passed. No physical display, NVDA or Orca peer was used; Braille keyboard input beyond pan and routing remains unsupported. +Forty-seventh implementation increment (2026-11-06): packaging. `remote/tentacle.toml` +declares protocol 1.1, the `session-events` and `remote-access` APIs and all six +remote grants; `make check` validates it with the reader's own negotiation rules. +`tools/package.py` builds a Tentacle from `cmd/` when present and can package +a manifest-only Tentacle into the generated `dist/catalog.toml` for review, while +the committed catalog stays unchanged until a verified release is published. +Reader `internal/datetime` gained a cgo-free fallback, because no Tentacle could +previously be built with the packager's `CGO_ENABLED=0`; this affected every +Tentacle, not only Remote. amd64 and arm64 archives were built and the extracted +amd64 binary ran through the reader's command host with every grant. Installation +through the reader's installer, ARM64 execution, publication and the catalog +entry remain human release steps. + ## 1. Intended result and recommended approach Build a native Go Tentacle named **Remote**, with package ID `remote`, in this @@ -1624,7 +1637,7 @@ features. A synthetic cell recorder cannot close physical Braille acceptance. - [ ] Add catalog/manifest only once the required reader API exists. Record the minimum supported reader/protocol and reject older hosts clearly. -- [ ] Extend `Makefile`, `tools/check.py`, `tools/package.py` and `.gitignore` for +- [x] Extend `Makefile`, `tools/check.py`, `tools/package.py` and `.gitignore` for Remote. Source build/check/ignore support now exists; catalog/release packaging remains unchanged and still needs explicit Remote support after readiness. - [ ] Package Linux amd64/arm64 native executables, README, license and required diff --git a/remote/README.md b/remote/README.md index 58c4ed4..c93a6f9 100644 --- a/remote/README.md +++ b/remote/README.md @@ -4,8 +4,10 @@ Remote will connect Cthulhu to an NVDA Remote protocol-v2 relay, as either a controller or a controlled computer. The first implementation increment is a tested Go relay library in `src/`. A subsequent increment now provides a source-built command with relay/role selection, reader-owned consent and connection -controls, limited reader speech observation and isolated incoming software speech. It has no manifest or catalog -entry and is not packaged as an installable release. +controls, speech, keyboard, clipboard text and Braille. A protocol 1.1 manifest +now exists and `tools/package.py --tentacle remote` builds review archives, but +Remote is not in the published catalog: live acceptance and a verified release +come first. See [the source command and physical-input checks](command.md). Implemented: diff --git a/remote/tentacle.toml b/remote/tentacle.toml new file mode 100644 index 0000000..05f5a65 --- /dev/null +++ b/remote/tentacle.toml @@ -0,0 +1,23 @@ +format-version = 1 +id = "remote" +name = "Remote" +description = "Control another computer or let a helper access this one over an NVDA Remote compatible relay: speech, keyboard, clipboard text and Braille, each approved per session." +version = "0.1.0" +authors = ["Storm Dragon"] +license = "GPL-3.0-or-later" +source = "https://git.stormux.org/storm/cthulhu-tentacles" +help = "README.md" +runtime = "native" +platforms = ["linux"] +entry-point = ["bin/remote"] +apis = ["commands", "session-events", "presentation", "interaction", "remote-access"] +capabilities = ["presentation", "interaction", "output-observe", "remote-present", "keyboard-capture", "keyboard-inject", "braille-stream", "clipboard-exchange"] + +[protocol] +major = 1 +minor = 1 + +[requirements] +reader = "Cthulhu with Tentacle protocol 1.1 and Remote session services, including cthulhu-input-helper for keyboard control and cthulhu-braille for Braille" +runtime = "Xorg for keyboard capture and injection; an independently hosted NVDA Remote protocol 2 relay" +build = "Go 1.24 or newer and the adjacent cthulhu source checkout" diff --git a/tools/check.py b/tools/check.py index 8faefb7..ab82f99 100644 --- a/tools/check.py +++ b/tools/check.py @@ -3,6 +3,7 @@ """Check the repository and the built Tentacle without running a reader.""" import json +import sys import hashlib import os from pathlib import Path @@ -154,9 +155,28 @@ def check_host(repoRoot, programPath, name): }, "The actual host returned an unexpected greeting") +def check_remote_manifest(repoRoot, readerRoot): + """Remote is not in the catalog until a release is published and verified.""" + manifest = read_toml(repoRoot / "remote/tentacle.toml") + require(manifest["format-version"] == 1 and manifest["id"] == "remote" and manifest["name"] == "Remote" + and manifest["runtime"] == "native" and manifest["platforms"] == ["linux"] + and manifest["entry-point"] == ["bin/remote"] + and manifest["protocol"] == {"major": 1, "minor": 1}, "Invalid Remote manifest") + require((repoRoot / "remote/LICENSE").is_file() and (repoRoot / "remote/README.md").is_file(), + "Remote license and help are required") + script = ("import json,sys; sys.path.insert(0, sys.argv[1]); " + "from cthulhu_tentacle.session import valid_negotiation; " + "print(json.dumps(valid_negotiation(json.loads(sys.argv[2]), json.loads(sys.argv[3]))))") + result = subprocess.run([sys.executable, "-I", "-c", script, str(readerRoot / "sdk/python"), + json.dumps(manifest["apis"]), json.dumps(manifest["capabilities"])], + capture_output=True, text=True, timeout=30, check=True) + require(json.loads(result.stdout) is True, "Remote manifest APIs and grants fail reader negotiation") + + def check_remote(repoRoot): programPath = repoRoot / "remote/bin/remote" readerRoot = repoRoot.parent / "cthulhu" + check_remote_manifest(repoRoot, readerRoot) environment = os.environ.copy() environment["CTHULHU_REMOTE_BINARY"] = str(programPath) with tempfile.TemporaryDirectory(prefix="cthulhu-remote-check-") as directory: diff --git a/tools/package.py b/tools/package.py index 8d07106..d8ab4eb 100644 --- a/tools/package.py +++ b/tools/package.py @@ -24,8 +24,10 @@ def build_package(repoRoot, architecture, version, name): programPath = distRoot / f"{name}-linux-{architecture}" environment = dict(os.environ, CGO_ENABLED="0", GOOS="linux", GOARCH=architecture) environment.setdefault("GOCACHE", "/tmp/cthulhu-cache") + # A Tentacle with a cmd/ main builds that; others build their src package. + mainPackage = f"./{name}/cmd/{name}" if (sourceRoot / "cmd" / name).is_dir() else f"./{name}/src" subprocess.run(["go", "build", "-buildvcs=false", "-mod=readonly", "-trimpath", - "-ldflags=-s -w", "-o", str(programPath), f"./{name}/src"], + "-ldflags=-s -w", "-o", str(programPath), mainPackage], cwd=repoRoot, env=environment, check=True) artifactPath = distRoot / f"{name}-{version}-linux-{architecture}.tar.gz" with artifactPath.open("wb") as output: @@ -60,8 +62,13 @@ def main(): catalog = tomllib.loads((repoRoot / "catalog.toml").read_text()) names = [item["id"] for item in catalog["tentacles"]] selected = args.tentacle or ["hello-world"] - if len(set(selected)) != len(selected) or any(name not in names for name in selected): - parser.error("Select distinct Tentacle IDs from catalog.toml") + # A Tentacle with a manifest but no published release (such as Remote before + # its first release) can be packaged for review; it appears only in the + # generated dist/catalog.toml, never in the committed catalog. + unpublished = [name for name in selected if name not in names and (repoRoot / name / "tentacle.toml").is_file()] + if len(set(selected)) != len(selected) or any(name not in names and name not in unpublished for name in selected): + parser.error("Select distinct Tentacle IDs from catalog.toml or with a tentacle.toml") + catalog["tentacles"] = catalog["tentacles"] + [{"id": name, "manifest": f"{name}/tentacle.toml"} for name in unpublished] lines = ["format-version = 1"] checksums = [] for item in catalog["tentacles"]: