APEX CNO

APEX Daily Pulse — 2026-11-19

Same Command, Different Evidence

[✅ Verified] Pillar: Operator workflow

Duration: 4–6 minutes

Reactivation target: Bind an evidence reader to its intended input, independent of the launch directory.

Prerequisites

[✅ Verified] Use an owned macOS or Linux host with Bash and Python 3.12+. No network, elevated privileges, or external packages are required. The fixture creates only temporary files.

Actions

  1. 1. Predict the input boundary. The reader below receives the same relative filename from two working directories. Identify which asset each launch will report before running it.

[✅ Verified] A relative input path resolves against the process working directory, not the location of the program that reads it.

  1. 2. Run the directory-drift fixture and its explicit-path control in Bash:
python3 - <<'PY'
import json
import subprocess
import sys
import tempfile
from pathlib import Path

root = Path(tempfile.mkdtemp(prefix="apex-cwd-")).resolve()
approved = root / "approved"
staging = root / "staging"

for directory, asset in (
 (approved, "sensor-A"),
 (staging, "sensor-B"),
):
 directory.mkdir()
 (directory / "evidence.json").write_text(
 json.dumps({"asset": asset, "findings": 0}),
 encoding="utf-8",
 )

reader = """
import argparse
import json
from pathlib import Path

parser = argparse.ArgumentParser()
parser.add_argument("--evidence", required=True, type=Path)
args = parser.parse_args()
source = args.evidence.resolve(strict=True)
record = json.loads(source.read_text(encoding="utf-8"))
print(json.dumps({"source": str(source), "asset": record["asset"]}))
"""

def collect(cwd: Path, evidence: Path) -> dict[str, str]:
 result = subprocess.run(
 [sys.executable, "-c", reader, "--evidence", str(evidence)],
 cwd=cwd,
 capture_output=True,
 text=True,
 check=True,
 )
 return json.loads(result.stdout)

relative = Path("evidence.json")
pinned = (approved / relative).resolve(strict=True)
results = {
 "relative_approved": collect(approved, relative),
 "relative_staging": collect(staging, relative),
 "pinned_approved": collect(approved, pinned),
 "pinned_staging": collect(staging, pinned),
}

passed = (
 results["relative_approved"]["asset"] == "sensor-A"
 and results["relative_staging"]["asset"] == "sensor-B"
 and results["pinned_approved"] == results["pinned_staging"]
 and results["pinned_staging"]["source"] == str(pinned)
 and results["pinned_staging"]["asset"] == "sensor-A"
)
report = {"results": results, "drill_passed": passed}
(root / "assessment.json").write_text(
 json.dumps(report, indent=2) + "\n", encoding="utf-8"
)

for label, record in results.items():
 print(f"{label} asset={record['asset']} source={record['source']}")
print(f"drill_passed={passed}")
print(f"evidence={root}")
raise SystemExit(0 if passed else 1)
PY
  1. 3. Inspect the four source paths. Confirm that the relative launches select different files. Confirm that both pinned launches select the approved file. Retain the printed directory and its assessment.json as the drill record.

Observable signal

[❓ Unverified] The fixture has not been executed here. Expected asset output, with source paths omitted:

relative_approved asset=sensor-A
relative_staging asset=sensor-B
pinned_approved asset=sensor-A
pinned_staging asset=sensor-A
drill_passed=True

Success condition

[✅ Verified] Pass only when both relative launches complete but report different assets, while both explicit-path launches report the same approved source and asset. Exit status zero means this fixture met those checks; it does not approve an operational evidence source.

Failure signature

[❌ Speculative] pinned_staging asset=sensor-B means the intended input binding did not hold. Check whether a wrapper rebuilt the path from its current directory or ignored the explicit argument. Stop evidence admission until the source is resolved.

Python-unavailable alternative

[✅ Verified] POSIX shell and cat can exercise the same file-selection boundary. Run this independent fixture:

sh <<'SH'
set -eu
lab=$(mktemp -d)
mkdir "$lab/approved" "$lab/staging"
printf '%s\n' sensor-A >"$lab/approved/evidence.txt"
printf '%s\n' sensor-B >"$lab/staging/evidence.txt"
pinned="$lab/approved/evidence.txt"

a=$(cd "$lab/approved" && cat evidence.txt)
b=$(cd "$lab/staging" && cat evidence.txt)
c=$(cd "$lab/approved" && cat "$pinned")
d=$(cd "$lab/staging" && cat "$pinned")

printf 'relative_approved=%s\nrelative_staging=%s\n' "$a" "$b"
printf 'pinned_approved=%s\npinned_staging=%s\n' "$c" "$d"
test "$a" = sensor-A
test "$b" = sensor-B
test "$c" = sensor-A
test "$d" = sensor-A
printf 'drill_passed=True\nevidence=%s\n' "$lab"
SH

[✅ Verified] Boundary: An absolute path removes working-directory ambiguity. It does not authenticate file contents or prevent replacement. The hidden assumption is that the selected directory and file remain trusted; writable files or symbolic links can invalidate that assumption.

Adaptation question

Which APEX collector inputs still depend on an interactive shell's working directory?