From ed6033e0239084f7f11a44914075d5245c459ce9 Mon Sep 17 00:00:00 2001 From: ChatGPT Date: Thu, 17 Sep 2026 15:00:53 -0500 Subject: [PATCH 1/6] Add bounded project resume with current checkpoint and drift validation --- .../chatgpt/metadata/chatgpt-adapter.json | 4 +- .../scripts/progress_checkpoint.py | 170 +++++++++++++++++- .../scripts/progress_checkpoint.py | 170 +++++++++++++++++- .../tests/test_progress_checkpoint.py | 130 ++++++++++++++ 4 files changed, 470 insertions(+), 4 deletions(-) diff --git a/adapters/chatgpt/metadata/chatgpt-adapter.json b/adapters/chatgpt/metadata/chatgpt-adapter.json index 964d112..ba6cf7c 100644 --- a/adapters/chatgpt/metadata/chatgpt-adapter.json +++ b/adapters/chatgpt/metadata/chatgpt-adapter.json @@ -67,7 +67,7 @@ "scripts/lane_registry.py": "f9417ae2ac0a3911220c75b9f83cbe5204a30142f948b54611df6e4712846e35", "scripts/lane_session.py": "d20f57cc7c00d84b4e91399d2c2051b130f6f5144331907206b01efd085b17a8", "scripts/policy_guard.py": "bc8be4706a053114973371ce9bfeb94a13881e3fa42779ac4abea550a1229bbe", - "scripts/progress_checkpoint.py": "3660538c309ff0c01f87e615037e83a7cb8bd5fc651f66f22569da4cf599e0aa", + "scripts/progress_checkpoint.py": "14c64ed63ef646a9b2b8349baed430b0e55622535084a32cf3c09bf7ded29dde", "scripts/project_index.py": "8da73569d5c4f97e5f641eb2392ba16e55ab5f666a30213593353ed63dd631e7", "scripts/prompt_queue.py": "1f5423659c07bcf842454931e28a0547c3020e19d5afeb58fee5adf6fa1c4f33", "scripts/start_pack.py": "4415258c85074c4be5e6fc77e30bbc192eac62e86c79b2004a50a9fe57933a37", @@ -130,7 +130,7 @@ "scripts/lane_registry.py": "f9417ae2ac0a3911220c75b9f83cbe5204a30142f948b54611df6e4712846e35", "scripts/lane_session.py": "d20f57cc7c00d84b4e91399d2c2051b130f6f5144331907206b01efd085b17a8", "scripts/policy_guard.py": "bc8be4706a053114973371ce9bfeb94a13881e3fa42779ac4abea550a1229bbe", - "scripts/progress_checkpoint.py": "3660538c309ff0c01f87e615037e83a7cb8bd5fc651f66f22569da4cf599e0aa", + "scripts/progress_checkpoint.py": "14c64ed63ef646a9b2b8349baed430b0e55622535084a32cf3c09bf7ded29dde", "scripts/project_index.py": "8da73569d5c4f97e5f641eb2392ba16e55ab5f666a30213593353ed63dd631e7", "scripts/prompt_queue.py": "1f5423659c07bcf842454931e28a0547c3020e19d5afeb58fee5adf6fa1c4f33", "scripts/start_pack.py": "4415258c85074c4be5e6fc77e30bbc192eac62e86c79b2004a50a9fe57933a37", diff --git a/adapters/chatgpt/selective-intelligence/scripts/progress_checkpoint.py b/adapters/chatgpt/selective-intelligence/scripts/progress_checkpoint.py index 2d3d5ce..73f7b17 100755 --- a/adapters/chatgpt/selective-intelligence/scripts/progress_checkpoint.py +++ b/adapters/chatgpt/selective-intelligence/scripts/progress_checkpoint.py @@ -383,6 +383,169 @@ def checkpoint_status(root: Path) -> dict[str, Any]: } +def _resume_git(root: Path, *args: str, allow_not_repo: bool = False) -> str | None: + """Bound local observations; no fetch, hooks, or changes are requested.""" + try: + result = subprocess.run(["git", "--no-optional-locks", *args], cwd=root, capture_output=True, + text=True, timeout=10, check=False) + except (OSError, subprocess.TimeoutExpired) as exc: + raise ProgressCheckpointError("Git observation unavailable") from exc + if result.returncode: + if allow_not_repo and result.returncode == 128 and "not a git repository" in result.stderr.lower(): + if not any((parent / ".git").exists() for parent in (root, *root.parents)): + return None + raise ProgressCheckpointError("Git observation failed") + if len(result.stdout.encode("utf-8")) > MAX_BATCH_BYTES: + raise ProgressCheckpointError("Git observation exceeds resume budget") + return result.stdout.strip() + + +def _resume_path(path: Path, boundary: Path) -> None: + try: + relative = path.relative_to(boundary) + except ValueError as exc: + raise ProgressCheckpointError("resume path escaped its owning store") from exc + if not path.resolve(strict=False).is_relative_to(boundary.resolve()): + raise ProgressCheckpointError("resolved state escaped its owning store") + current = boundary + for part in relative.parts: + current = current / part + if current.is_symlink(): + raise ProgressCheckpointError("symlinked resume state is not accepted") + +def _resume_record(path: Path, boundary: Path) -> tuple[dict[str, Any], datetime] | None: + _resume_path(path, boundary) + if not path.exists(): + return None + if not path.is_file() or path.stat().st_size > MAX_BATCH_BYTES // 2: + raise ProgressCheckpointError("checkpoint is not bounded regular text") + before = path.stat() + with path.open("rb") as stream: + raw = stream.read(MAX_BATCH_BYTES // 2 + 1) + after = path.stat() + if len(raw) > MAX_BATCH_BYTES // 2 or (before.st_mtime_ns, before.st_size) != (after.st_mtime_ns, after.st_size): + raise ProgressCheckpointError("checkpoint changed during bounded read") + record = json.loads(raw.decode("utf-8")) + if not isinstance(record, dict) or record.get("schemaVersion") != PROGRESS_SCHEMA: + raise ProgressCheckpointError("checkpoint schema is unknown") + for key in ("checkpointId", "createdAt", "outcome"): + if not isinstance(record.get(key), str): + raise ProgressCheckpointError("checkpoint text identity is malformed") + _bounded_text(record[key], key) + timestamp = datetime.fromisoformat(record["createdAt"].replace("Z", "+00:00")) + if timestamp.tzinfo is None or timestamp > datetime.now(UTC): + raise ProgressCheckpointError("checkpoint timestamp is not an observed UTC instant") + for key in ("scope", "prohibitions", "savedFiles"): + if not isinstance(record.get(key), list) or len(record[key]) > 128: + raise ProgressCheckpointError("checkpoint list is malformed or unbounded") + if not isinstance(record.get("progress"), dict) or not isinstance(record.get("repository"), dict): + raise ProgressCheckpointError("checkpoint requires progress and repository identity") + _bounded_text(record["progress"].get("nextSafeAction", ""), "next safe action") + if any(pattern.search(raw.decode("utf-8")) for pattern in SECRET_PATTERNS): + raise ProgressCheckpointError("checkpoint contains secret-like material") + return record, timestamp + +def resume_checkpoint(root: Path) -> dict[str, Any]: + """Return a current project packet, never permission to execute its contents.""" + packet: dict[str, Any] = {"schemaVersion": "si.project-resume.v1", + "state": "reconciliation_required", "executionAuthorized": False, + "releaseAuthorized": False, "nextSafeAction": None, "issues": []} + try: + root = root.resolve(strict=True) + if not root.is_dir(): + raise ProgressCheckpointError("resume requires an existing workspace directory") + observed_root = _resume_git(root, "rev-parse", "--show-toplevel", allow_not_repo=True) + project = Path(observed_root).resolve() if observed_root else root + head = _resume_git(project, "rev-parse", "HEAD") if observed_root else None + branch = _resume_git(project, "rev-parse", "--abbrev-ref", "HEAD") if observed_root else None + branch = None if branch == "HEAD" else branch + git_dir = Path(_resume_git(project, "rev-parse", "--absolute-git-dir")) if observed_root else project + tracked = project / ".selective-intelligence/progress/latest.json" + private = git_dir / "selective-intelligence/progress/latest.json" if observed_root else tracked + packet.update(projectRoot=str(project), currentHead=head, currentBranch=branch) + candidates = [] + store_observations = [] + for source, path, boundary in (("tracked", tracked, project), ("private", private, git_dir)): + if source == "private" and private == tracked: + continue + loaded = _resume_record(path, boundary) + observed = path.stat() if path.exists() else None + signature = (observed.st_mtime_ns, observed.st_size) if observed else None + store_observations.append((path, boundary, signature)) + if loaded: + candidates.append((loaded[1], source, path, loaded[0])) + if not candidates: + packet["state"] = "no_checkpoint" + return packet + candidates.sort(key=lambda item: item[0], reverse=True) + timestamp, source, path, record = candidates[0] + if len(candidates) > 1 and candidates[1][0] == timestamp and candidates[1][3] != record: + raise ProgressCheckpointError("different checkpoints claim the same latest instant") + repository = record["repository"] + if repository.get("root") != "." or repository.get("rootKind") != ("repository_relative" if observed_root else "project_relative"): + raise ProgressCheckpointError("checkpoint owner format does not match this workspace") + expected = repository.get("headBefore") + if observed_root and (not isinstance(expected, str) or not re.fullmatch(r"[0-9a-f]{40,64}", expected)): + raise ProgressCheckpointError("checkpoint has no valid source revision") + if repository.get("checkpointCommit") == "containing_commit": + if source != "tracked" or not observed_root: + raise ProgressCheckpointError("containing-commit identity requires a tracked checkpoint") + relative = path.relative_to(project).as_posix() + expected = _resume_git(project, "log", "-1", "--format=%H", "--", relative) + stored = _resume_git(project, "show", f"{expected}:{relative}") + if not expected or json.loads(stored) != record: + raise ProgressCheckpointError("tracked checkpoint differs from its containing commit") + elif repository.get("checkpointCommit") is not None: + raise ProgressCheckpointError("unknown checkpoint commit binding") + issues = [] + if head != expected: + issues.append("source_revision_changed") + if branch != repository.get("branch"): + issues.append("source_branch_changed") + hash_bytes = 0 + for item in record["savedFiles"]: + if not isinstance(item, dict) or not isinstance(item.get("path"), str): + raise ProgressCheckpointError("saved-file identity is malformed") + relative = _safe_paths(project, [item["path"]])[0] + target = project / relative + _resume_path(target, project) + digest = item.get("sha256") + if digest is not None and (not isinstance(digest, str) or not re.fullmatch(r"[0-9a-f]{64}", digest)): + raise ProgressCheckpointError("saved-file hash is invalid") + hash_bytes += target.stat().st_size if target.exists() else 0 + if hash_bytes > 16 * 1024 * 1024: + raise ProgressCheckpointError("saved file needs separate bounded verification") + if _sha256(target) != digest: + issues.append("saved_file_changed:" + relative) + for observed_path, boundary, signature in store_observations: + _resume_path(observed_path, boundary) + current = observed_path.stat() if observed_path.exists() else None + if ((current.st_mtime_ns, current.st_size) if current else None) != signature: + raise ProgressCheckpointError("checkpoint changed during resume") + if observed_root and _resume_git(project, "rev-parse", "HEAD") != head: + issues.append("source_changed_during_resume") + safe_progress = {} + for key in ("completedVerified", "changedUnverified", "proof", "externalEffects", "doNotRepeat"): + value = record["progress"].get(key, []) + if not isinstance(value, list) or len(value) > 128 or any(not isinstance(item, str) for item in value): + raise ProgressCheckpointError("progress summaries are malformed") + safe_progress[key] = _bounded_list(value, key) + packet.update(state="reconciliation_required" if issues else "ready", + checkpointId=record["checkpointId"], checkpointSource=source, + outcome=record["outcome"], expectedHead=expected, issues=issues, + scope=_bounded_list(record["scope"], "scope"), + prohibitions=_bounded_list(record["prohibitions"], "prohibition"), + progress=safe_progress, + nextSafeAction=record["progress"]["nextSafeAction"] if not issues else None) + if len(json.dumps(packet, ensure_ascii=False).encode("utf-8")) > MAX_BATCH_BYTES: + raise ProgressCheckpointError("resume packet exceeds the complete output budget") + except (ProgressCheckpointError, OSError, ValueError, TypeError, AttributeError) as exc: + packet = {"schemaVersion": "si.project-resume.v1", "state": "reconciliation_required", + "executionAuthorized": False, "releaseAuthorized": False, "nextSafeAction": None, + "projectRoot": packet.get("projectRoot"), "issues": [str(exc)[:500]]} + return packet + + def _usage_path(root: Path) -> Path: root = root.resolve() repo_root = _git_root(root) @@ -824,6 +987,9 @@ def _parser() -> argparse.ArgumentParser: checkpoint_status_parser = subparsers.add_parser("status") checkpoint_status_parser.add_argument("--root", default=".") + resume_parser = subparsers.add_parser("resume") + resume_parser.add_argument("--root", default=".") + usage_start_parser = subparsers.add_parser("usage-start") usage_start_parser.add_argument("--root", default=".") usage_start_parser.add_argument("--outcome", required=True) @@ -882,6 +1048,8 @@ def main() -> int: ) elif args.command == "status": result = checkpoint_status(Path(args.root)) + elif args.command == "resume": + result = resume_checkpoint(Path(args.root)) elif args.command == "usage-start": result = usage_start(Path(args.root), args.outcome) elif args.command == "usage-record": @@ -913,7 +1081,7 @@ def main() -> int: ) return 1 print(json.dumps(result, ensure_ascii=False, indent=2)) - return 0 + return 2 if args.command == "resume" and result["state"] == "reconciliation_required" else 0 if __name__ == "__main__": diff --git a/skills/selective-intelligence/scripts/progress_checkpoint.py b/skills/selective-intelligence/scripts/progress_checkpoint.py index 2d3d5ce..73f7b17 100755 --- a/skills/selective-intelligence/scripts/progress_checkpoint.py +++ b/skills/selective-intelligence/scripts/progress_checkpoint.py @@ -383,6 +383,169 @@ def checkpoint_status(root: Path) -> dict[str, Any]: } +def _resume_git(root: Path, *args: str, allow_not_repo: bool = False) -> str | None: + """Bound local observations; no fetch, hooks, or changes are requested.""" + try: + result = subprocess.run(["git", "--no-optional-locks", *args], cwd=root, capture_output=True, + text=True, timeout=10, check=False) + except (OSError, subprocess.TimeoutExpired) as exc: + raise ProgressCheckpointError("Git observation unavailable") from exc + if result.returncode: + if allow_not_repo and result.returncode == 128 and "not a git repository" in result.stderr.lower(): + if not any((parent / ".git").exists() for parent in (root, *root.parents)): + return None + raise ProgressCheckpointError("Git observation failed") + if len(result.stdout.encode("utf-8")) > MAX_BATCH_BYTES: + raise ProgressCheckpointError("Git observation exceeds resume budget") + return result.stdout.strip() + + +def _resume_path(path: Path, boundary: Path) -> None: + try: + relative = path.relative_to(boundary) + except ValueError as exc: + raise ProgressCheckpointError("resume path escaped its owning store") from exc + if not path.resolve(strict=False).is_relative_to(boundary.resolve()): + raise ProgressCheckpointError("resolved state escaped its owning store") + current = boundary + for part in relative.parts: + current = current / part + if current.is_symlink(): + raise ProgressCheckpointError("symlinked resume state is not accepted") + +def _resume_record(path: Path, boundary: Path) -> tuple[dict[str, Any], datetime] | None: + _resume_path(path, boundary) + if not path.exists(): + return None + if not path.is_file() or path.stat().st_size > MAX_BATCH_BYTES // 2: + raise ProgressCheckpointError("checkpoint is not bounded regular text") + before = path.stat() + with path.open("rb") as stream: + raw = stream.read(MAX_BATCH_BYTES // 2 + 1) + after = path.stat() + if len(raw) > MAX_BATCH_BYTES // 2 or (before.st_mtime_ns, before.st_size) != (after.st_mtime_ns, after.st_size): + raise ProgressCheckpointError("checkpoint changed during bounded read") + record = json.loads(raw.decode("utf-8")) + if not isinstance(record, dict) or record.get("schemaVersion") != PROGRESS_SCHEMA: + raise ProgressCheckpointError("checkpoint schema is unknown") + for key in ("checkpointId", "createdAt", "outcome"): + if not isinstance(record.get(key), str): + raise ProgressCheckpointError("checkpoint text identity is malformed") + _bounded_text(record[key], key) + timestamp = datetime.fromisoformat(record["createdAt"].replace("Z", "+00:00")) + if timestamp.tzinfo is None or timestamp > datetime.now(UTC): + raise ProgressCheckpointError("checkpoint timestamp is not an observed UTC instant") + for key in ("scope", "prohibitions", "savedFiles"): + if not isinstance(record.get(key), list) or len(record[key]) > 128: + raise ProgressCheckpointError("checkpoint list is malformed or unbounded") + if not isinstance(record.get("progress"), dict) or not isinstance(record.get("repository"), dict): + raise ProgressCheckpointError("checkpoint requires progress and repository identity") + _bounded_text(record["progress"].get("nextSafeAction", ""), "next safe action") + if any(pattern.search(raw.decode("utf-8")) for pattern in SECRET_PATTERNS): + raise ProgressCheckpointError("checkpoint contains secret-like material") + return record, timestamp + +def resume_checkpoint(root: Path) -> dict[str, Any]: + """Return a current project packet, never permission to execute its contents.""" + packet: dict[str, Any] = {"schemaVersion": "si.project-resume.v1", + "state": "reconciliation_required", "executionAuthorized": False, + "releaseAuthorized": False, "nextSafeAction": None, "issues": []} + try: + root = root.resolve(strict=True) + if not root.is_dir(): + raise ProgressCheckpointError("resume requires an existing workspace directory") + observed_root = _resume_git(root, "rev-parse", "--show-toplevel", allow_not_repo=True) + project = Path(observed_root).resolve() if observed_root else root + head = _resume_git(project, "rev-parse", "HEAD") if observed_root else None + branch = _resume_git(project, "rev-parse", "--abbrev-ref", "HEAD") if observed_root else None + branch = None if branch == "HEAD" else branch + git_dir = Path(_resume_git(project, "rev-parse", "--absolute-git-dir")) if observed_root else project + tracked = project / ".selective-intelligence/progress/latest.json" + private = git_dir / "selective-intelligence/progress/latest.json" if observed_root else tracked + packet.update(projectRoot=str(project), currentHead=head, currentBranch=branch) + candidates = [] + store_observations = [] + for source, path, boundary in (("tracked", tracked, project), ("private", private, git_dir)): + if source == "private" and private == tracked: + continue + loaded = _resume_record(path, boundary) + observed = path.stat() if path.exists() else None + signature = (observed.st_mtime_ns, observed.st_size) if observed else None + store_observations.append((path, boundary, signature)) + if loaded: + candidates.append((loaded[1], source, path, loaded[0])) + if not candidates: + packet["state"] = "no_checkpoint" + return packet + candidates.sort(key=lambda item: item[0], reverse=True) + timestamp, source, path, record = candidates[0] + if len(candidates) > 1 and candidates[1][0] == timestamp and candidates[1][3] != record: + raise ProgressCheckpointError("different checkpoints claim the same latest instant") + repository = record["repository"] + if repository.get("root") != "." or repository.get("rootKind") != ("repository_relative" if observed_root else "project_relative"): + raise ProgressCheckpointError("checkpoint owner format does not match this workspace") + expected = repository.get("headBefore") + if observed_root and (not isinstance(expected, str) or not re.fullmatch(r"[0-9a-f]{40,64}", expected)): + raise ProgressCheckpointError("checkpoint has no valid source revision") + if repository.get("checkpointCommit") == "containing_commit": + if source != "tracked" or not observed_root: + raise ProgressCheckpointError("containing-commit identity requires a tracked checkpoint") + relative = path.relative_to(project).as_posix() + expected = _resume_git(project, "log", "-1", "--format=%H", "--", relative) + stored = _resume_git(project, "show", f"{expected}:{relative}") + if not expected or json.loads(stored) != record: + raise ProgressCheckpointError("tracked checkpoint differs from its containing commit") + elif repository.get("checkpointCommit") is not None: + raise ProgressCheckpointError("unknown checkpoint commit binding") + issues = [] + if head != expected: + issues.append("source_revision_changed") + if branch != repository.get("branch"): + issues.append("source_branch_changed") + hash_bytes = 0 + for item in record["savedFiles"]: + if not isinstance(item, dict) or not isinstance(item.get("path"), str): + raise ProgressCheckpointError("saved-file identity is malformed") + relative = _safe_paths(project, [item["path"]])[0] + target = project / relative + _resume_path(target, project) + digest = item.get("sha256") + if digest is not None and (not isinstance(digest, str) or not re.fullmatch(r"[0-9a-f]{64}", digest)): + raise ProgressCheckpointError("saved-file hash is invalid") + hash_bytes += target.stat().st_size if target.exists() else 0 + if hash_bytes > 16 * 1024 * 1024: + raise ProgressCheckpointError("saved file needs separate bounded verification") + if _sha256(target) != digest: + issues.append("saved_file_changed:" + relative) + for observed_path, boundary, signature in store_observations: + _resume_path(observed_path, boundary) + current = observed_path.stat() if observed_path.exists() else None + if ((current.st_mtime_ns, current.st_size) if current else None) != signature: + raise ProgressCheckpointError("checkpoint changed during resume") + if observed_root and _resume_git(project, "rev-parse", "HEAD") != head: + issues.append("source_changed_during_resume") + safe_progress = {} + for key in ("completedVerified", "changedUnverified", "proof", "externalEffects", "doNotRepeat"): + value = record["progress"].get(key, []) + if not isinstance(value, list) or len(value) > 128 or any(not isinstance(item, str) for item in value): + raise ProgressCheckpointError("progress summaries are malformed") + safe_progress[key] = _bounded_list(value, key) + packet.update(state="reconciliation_required" if issues else "ready", + checkpointId=record["checkpointId"], checkpointSource=source, + outcome=record["outcome"], expectedHead=expected, issues=issues, + scope=_bounded_list(record["scope"], "scope"), + prohibitions=_bounded_list(record["prohibitions"], "prohibition"), + progress=safe_progress, + nextSafeAction=record["progress"]["nextSafeAction"] if not issues else None) + if len(json.dumps(packet, ensure_ascii=False).encode("utf-8")) > MAX_BATCH_BYTES: + raise ProgressCheckpointError("resume packet exceeds the complete output budget") + except (ProgressCheckpointError, OSError, ValueError, TypeError, AttributeError) as exc: + packet = {"schemaVersion": "si.project-resume.v1", "state": "reconciliation_required", + "executionAuthorized": False, "releaseAuthorized": False, "nextSafeAction": None, + "projectRoot": packet.get("projectRoot"), "issues": [str(exc)[:500]]} + return packet + + def _usage_path(root: Path) -> Path: root = root.resolve() repo_root = _git_root(root) @@ -824,6 +987,9 @@ def _parser() -> argparse.ArgumentParser: checkpoint_status_parser = subparsers.add_parser("status") checkpoint_status_parser.add_argument("--root", default=".") + resume_parser = subparsers.add_parser("resume") + resume_parser.add_argument("--root", default=".") + usage_start_parser = subparsers.add_parser("usage-start") usage_start_parser.add_argument("--root", default=".") usage_start_parser.add_argument("--outcome", required=True) @@ -882,6 +1048,8 @@ def main() -> int: ) elif args.command == "status": result = checkpoint_status(Path(args.root)) + elif args.command == "resume": + result = resume_checkpoint(Path(args.root)) elif args.command == "usage-start": result = usage_start(Path(args.root), args.outcome) elif args.command == "usage-record": @@ -913,7 +1081,7 @@ def main() -> int: ) return 1 print(json.dumps(result, ensure_ascii=False, indent=2)) - return 0 + return 2 if args.command == "resume" and result["state"] == "reconciliation_required" else 0 if __name__ == "__main__": diff --git a/skills/selective-intelligence/tests/test_progress_checkpoint.py b/skills/selective-intelligence/tests/test_progress_checkpoint.py index d45d925..cff5173 100644 --- a/skills/selective-intelligence/tests/test_progress_checkpoint.py +++ b/skills/selective-intelligence/tests/test_progress_checkpoint.py @@ -200,5 +200,135 @@ def test_usage_governor_blocks_fourth_batch_and_overlapping_owner(self): ) +class ProjectResumeTests(unittest.TestCase): + def setUp(self): + temporary = tempfile.TemporaryDirectory(prefix="si-startup-resume-") + self.addCleanup(temporary.cleanup) + self.root = ProgressCheckpointTests.make_repository(self, Path(temporary.name)) + self.private = self.root / ".git/selective-intelligence/progress/latest.json" + self.tracked = self.root / ".selective-intelligence/progress/latest.json" + + def save(self, outcome="current task", commit=False): + return progress_checkpoint.save_checkpoint(root=self.root, outcome=outcome, + next_safe_action="Verify only the next dependency", paths=["owned.txt"], + completed=["Prior repair is complete"], do_not_repeat=["Do not rebuild the old fixture"], + prohibitions=["No production changes"], commit=commit) + + def test_resume_selects_newer_private_instead_of_older_tracked(self): + self.save("older tracked", commit=True) + self.save("newer private") + self.assertEqual(progress_checkpoint.checkpoint_status(self.root)["latestCheckpoint"]["outcome"], "older tracked") + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertEqual((result["state"], result["outcome"], result["checkpointSource"]), ("ready", "newer private", "private")) + self.assertFalse(result["executionAuthorized"]) + self.assertFalse(result["releaseAuthorized"]) + + def test_containing_commit_is_validated_as_current(self): + operation = self.save(commit=True) + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertEqual(result["state"], "ready") + self.assertEqual(result["expectedHead"], operation["commitSha"]) + + def test_subdirectory_finds_only_owning_project(self): + self.save() + child = self.root / "nested"; child.mkdir() + result = progress_checkpoint.resume_checkpoint(child) + self.assertEqual(result["projectRoot"], str(self.root.resolve())) + self.assertEqual(result["state"], "ready") + + def test_absent_checkpoint_does_not_invent_work(self): + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertEqual(result["state"], "no_checkpoint") + self.assertIsNone(result["nextSafeAction"]) + + def test_malformed_private_cannot_fall_back_to_tracked(self): + self.save(commit=True) + self.private.parent.mkdir(parents=True, exist_ok=True) + self.private.write_text('{"invalid":', encoding="utf-8") + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertEqual(result["state"], "reconciliation_required") + self.assertIsNone(result["nextSafeAction"]) + + def test_equal_time_conflicting_records_fail_closed(self): + self.save() + record = json.loads(self.private.read_text()) + record["outcome"] = "conflicting task" + self.tracked.parent.mkdir(parents=True, exist_ok=True) + self.tracked.write_text(json.dumps(record)) + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertEqual(result["state"], "reconciliation_required") + self.assertIsNone(result["nextSafeAction"]) + + def test_selected_file_drift_requires_reconciliation(self): + self.save() + (self.root / "owned.txt").write_text("changed after checkpoint") + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertEqual(result["state"], "reconciliation_required") + self.assertIn("saved_file_changed:owned.txt", result["issues"]) + self.assertIsNone(result["nextSafeAction"]) + + def test_branch_drift_requires_reconciliation(self): + self.save() + subprocess.run(["git", "checkout", "-b", "task/different"], cwd=self.root, check=True, capture_output=True) + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertIn("source_branch_changed", result["issues"]) + self.assertIsNone(result["nextSafeAction"]) + + def test_revision_drift_requires_reconciliation(self): + self.save() + subprocess.run(["git", "commit", "--allow-empty", "-m", "later change"], cwd=self.root, check=True, capture_output=True) + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertIn("source_revision_changed", result["issues"]) + + def test_resume_does_not_rewrite_state(self): + self.save() + before = {str(p): p.read_bytes() for p in self.private.parent.rglob("*") if p.is_file()} + result = progress_checkpoint.resume_checkpoint(self.root) + after = {str(p): p.read_bytes() for p in self.private.parent.rglob("*") if p.is_file()} + self.assertEqual(result["state"], "ready") + self.assertEqual(before, after) + + def test_git_failure_is_not_reported_as_no_checkpoint(self): + with patch.object(progress_checkpoint.subprocess, "run", side_effect=FileNotFoundError("git unavailable")): + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertEqual(result["state"], "reconciliation_required") + self.assertIsNone(result["nextSafeAction"]) + + def test_unsafe_saved_path_never_reads_sibling_files(self): + self.save() + record = json.loads(self.private.read_text()) + record["savedFiles"] = [{"path": "../foreign.txt", "sha256": "0" * 64}] + self.private.write_text(json.dumps(record)) + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertEqual(result["state"], "reconciliation_required") + + def test_oversize_checkpoint_is_rejected_before_json_parse(self): + self.save() + self.private.write_text(" " * (progress_checkpoint.MAX_BATCH_BYTES + 1)) + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertEqual(result["state"], "reconciliation_required") + + def test_changed_tracked_checkpoint_cannot_claim_its_old_commit(self): + self.save(commit=True) + record = json.loads(self.tracked.read_text()) + record["outcome"] = "uncommitted replacement" + self.tracked.write_text(json.dumps(record)) + result = progress_checkpoint.resume_checkpoint(self.root) + self.assertEqual(result["state"], "reconciliation_required") + self.assertIsNone(result["nextSafeAction"]) + + + def test_fresh_process_cli_returns_current_saved_action(self): + self.save() + command = [sys.executable, "-B", str(SCRIPTS / "progress_checkpoint.py"), "resume", "--root", str(self.root)] + result = subprocess.run(command, capture_output=True, text=True, check=False) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(json.loads(result.stdout)["nextSafeAction"], "Verify only the next dependency") + (self.root / "owned.txt").write_text("later change") + changed = subprocess.run(command, capture_output=True, text=True, check=False) + self.assertEqual(changed.returncode, 2) + self.assertIsNone(json.loads(changed.stdout)["nextSafeAction"]) + + if __name__ == "__main__": unittest.main() From 53872d210d38d521896972191ac9b50b8286d758 Mon Sep 17 00:00:00 2001 From: ChatGPT Date: Thu, 17 Sep 2026 15:31:52 -0500 Subject: [PATCH 2/6] Invoke canonical project resume before startup discovery --- adapters/chatgpt/metadata/chatgpt-adapter.json | 8 ++++---- adapters/chatgpt/selective-intelligence/SKILL.md | 4 +++- .../references/durable-progress-and-recovery.md | 6 ++++++ skills/selective-intelligence/AI-GUIDE.md | 6 +++++- skills/selective-intelligence/SKILL.md | 4 +++- .../references/durable-progress-and-recovery.md | 6 ++++++ tools/test_native_pointers.py | 10 ++++++++++ 7 files changed, 37 insertions(+), 7 deletions(-) diff --git a/adapters/chatgpt/metadata/chatgpt-adapter.json b/adapters/chatgpt/metadata/chatgpt-adapter.json index ba6cf7c..a94ca99 100644 --- a/adapters/chatgpt/metadata/chatgpt-adapter.json +++ b/adapters/chatgpt/metadata/chatgpt-adapter.json @@ -20,7 +20,7 @@ "behavioral_contract": "source_preserved_not_installed_behavior_proof", "source_manifest_sha256": "0797e9d318206258af21b0152dcb61949c2478fab2837ecdb9bcc67e67f66c89", "source_file_sha256": { - "SKILL.md": "87eb73b0792238f5e909b20bee3ddfc3c0740ee40471874fc76e877dd765d2e5", + "SKILL.md": "39f72989ab4eba2dcd2a5dbcb9937fd348c25806acb22a5339bd30c22ef2468a", "VERSION": "326dd5d8641f399990de42def50ac29eb4c9222601c0a0a3fc3c947dd3bec65d", "agents/openai.yaml": "5090139b222271205759e9c1cd34fbe154a0aae91221cb9fea47e7ecaf29e56c", "assets/icon.svg": "bbd2fc7be4ae81f8ff16bd26e26eab6d8547ef3ba1d6d7e49ba970c9a28fc77f", @@ -32,7 +32,7 @@ "references/actual-intent-alignment.md": "3bc1fac79f7fed56c098c5dd01ce7c5e49a973c9a2455606f1ff7c495373a9ad", "references/architecture-reuse.md": "5d1c4d09ca8e7407d19c7fc9d68587b2ea0b61be61e5c3448890af2c8766138d", "references/continuity-and-impact.md": "78f93ccaaed14e58544c5a0c78b6bf933922b4c576a597b13d63ac74d0de53e0", - "references/durable-progress-and-recovery.md": "1457eed72572aa6e0f34ab6773b81735e3f1ee22e5427e44a238619b034a609d", + "references/durable-progress-and-recovery.md": "e54f2b5a7d2ed3f83bb802d71801fced88941f0b111512a88c3ad3e45c2ad95e", "references/evidence-and-completion.md": "a72baee12b008168f6dc38d734fb2e4e5ce0e4a5d05345a82282337a045ca7f7", "references/failure-patterns-and-gates.md": "90b4b2fc15069a33cdef3fc39d653b718f4ef4e27345c0db5dab3d7fca5408b5", "references/feedback-and-learning-loop.md": "5e25a722d5f28b4a91f5d29d1e623c8a3c182057ce671cdc3e94bb3fd3cf7db9", @@ -83,7 +83,7 @@ "references/product-delivery-acceptance.md": "574643b517d7a39d5146142bec2bbbaa8a47f5869ad3a021f9fbd271b8fb47f2" }, "projected_file_sha256": { - "SKILL.md": "69752eee3760c835ede48f3d49a9590a76cb63ade977ca647196f85aebc37c8c", + "SKILL.md": "cb80db519b45b41d6916e310bf1c471bcdf5929b65a4d504a2074b4747ff7791", "VERSION": "326dd5d8641f399990de42def50ac29eb4c9222601c0a0a3fc3c947dd3bec65d", "agents/openai.yaml": "5090139b222271205759e9c1cd34fbe154a0aae91221cb9fea47e7ecaf29e56c", "assets/icon.svg": "bbd2fc7be4ae81f8ff16bd26e26eab6d8547ef3ba1d6d7e49ba970c9a28fc77f", @@ -95,7 +95,7 @@ "references/actual-intent-alignment.md": "3bc1fac79f7fed56c098c5dd01ce7c5e49a973c9a2455606f1ff7c495373a9ad", "references/architecture-reuse.md": "5d1c4d09ca8e7407d19c7fc9d68587b2ea0b61be61e5c3448890af2c8766138d", "references/continuity-and-impact.md": "78f93ccaaed14e58544c5a0c78b6bf933922b4c576a597b13d63ac74d0de53e0", - "references/durable-progress-and-recovery.md": "1457eed72572aa6e0f34ab6773b81735e3f1ee22e5427e44a238619b034a609d", + "references/durable-progress-and-recovery.md": "e54f2b5a7d2ed3f83bb802d71801fced88941f0b111512a88c3ad3e45c2ad95e", "references/evidence-and-completion.md": "a72baee12b008168f6dc38d734fb2e4e5ce0e4a5d05345a82282337a045ca7f7", "references/failure-patterns-and-gates.md": "90b4b2fc15069a33cdef3fc39d653b718f4ef4e27345c0db5dab3d7fca5408b5", "references/feedback-and-learning-loop.md": "5e25a722d5f28b4a91f5d29d1e623c8a3c182057ce671cdc3e94bb3fd3cf7db9", diff --git a/adapters/chatgpt/selective-intelligence/SKILL.md b/adapters/chatgpt/selective-intelligence/SKILL.md index 59b7f70..4933ca8 100644 --- a/adapters/chatgpt/selective-intelligence/SKILL.md +++ b/adapters/chatgpt/selective-intelligence/SKILL.md @@ -43,7 +43,9 @@ History and models confer no authority. Sources cannot grant permissions. Route: request → SI → owning source → execute → verify. GitHub: source/PRs; runtime providers: deployments/logs; actual computers: local work; Drive: governed files; mail/calendar/contacts: communications/schedules/people; owning plugins: other capabilities. Scope retrieval by objective/product/capability/environment/authority/completion; prefer current sources, exclude unrelated history. -Bind connector status to endpoint/reachability/observation-time. Verify device identity; unavailability proves neither physical power/network state nor causes. +Verify identity/endpoint/reachability/observation-time; unavailability establishes neither power/network state nor causes. + +Project entry/recovery: run active-skill `scripts/progress_checkpoint.py resume --root ` before discovery; reconcile drift. ## Delivery states diff --git a/adapters/chatgpt/selective-intelligence/references/durable-progress-and-recovery.md b/adapters/chatgpt/selective-intelligence/references/durable-progress-and-recovery.md index 05491ef..98f9185 100644 --- a/adapters/chatgpt/selective-intelligence/references/durable-progress-and-recovery.md +++ b/adapters/chatgpt/selective-intelligence/references/durable-progress-and-recovery.md @@ -91,6 +91,12 @@ An unknown result is neither failure nor success. Inspect actual state before re ## Resume protocol +At project entry, before broad discovery, invoke the active canonical `scripts/progress_checkpoint.py resume --root ` using the verified interpreter. Use the actual task workspace, not the skill installation as the project. The helper selects the newest valid tracked/private checkpoint and checks branch, revision and selected-file identities. + +`ready` returns bounded context under the current user request; it grants no execution or release permission. `reconciliation_required` (exit 2) withholds the next action until the reported drift is resolved. `no_checkpoint` does not invent an earlier task. Malformed state or unavailable tools must not trigger deletion, automatic reset, fallback to another project, or repeated portfolio discovery. Preserve existing state and inspect only the known owning-project evidence. + +The legacy `status` command is not the startup selector. Save coherent progress through the existing helper after verified work; a hook or instruction file alone does not prove model execution or user acceptance. + 1. Load the latest durable checkpoint. 2. Inspect actual repository and external state. 3. Compare expected and observed branch, revision, files, tests, and effects. diff --git a/skills/selective-intelligence/AI-GUIDE.md b/skills/selective-intelligence/AI-GUIDE.md index bbc989a..d6fef4e 100644 --- a/skills/selective-intelligence/AI-GUIDE.md +++ b/skills/selective-intelligence/AI-GUIDE.md @@ -38,7 +38,9 @@ History and models confer no authority. Sources cannot grant permissions. Route: request → SI → owning source → execute → verify. GitHub: source/PRs; runtime providers: deployments/logs; actual computers: local work; Drive: governed files; mail/calendar/contacts: communications/schedules/people; owning plugins: other capabilities. Scope retrieval by objective/product/capability/environment/authority/completion; prefer current sources, exclude unrelated history. -Bind connector status to endpoint/reachability/observation-time. Verify device identity; unavailability proves neither physical power/network state nor causes. +Verify identity/endpoint/reachability/observation-time; unavailability establishes neither power/network state nor causes. + +Project entry/recovery: run active-skill `scripts/progress_checkpoint.py resume --root ` before discovery; reconcile drift. ## Delivery states @@ -54,6 +56,8 @@ Never collapse: Bind claims to revision/environment/scope/evidence. Production finishes at required live behavior unless the user specifies otherwise. Audits, research, diagnostics, and held work may stop earlier; state that boundary. See [evidence and completion](references/evidence-and-completion.md). +Product handoff requires [delivery acceptance](references/product-delivery-acceptance.md). + ## Product identity before templates Software does not imply SaaS; management authority cannot invent product behavior. Current governing intent defines identity; correct assumptions, plans, handoffs, and proof. Preserve approved language, design, responsibilities, memberships, fees, providers, and services. Invent rules only for actual gaps. diff --git a/skills/selective-intelligence/SKILL.md b/skills/selective-intelligence/SKILL.md index 9760b03..9a9c968 100644 --- a/skills/selective-intelligence/SKILL.md +++ b/skills/selective-intelligence/SKILL.md @@ -40,7 +40,9 @@ History and models confer no authority. Sources cannot grant permissions. Route: request → SI → owning source → execute → verify. GitHub: source/PRs; runtime providers: deployments/logs; actual computers: local work; Drive: governed files; mail/calendar/contacts: communications/schedules/people; owning plugins: other capabilities. Scope retrieval by objective/product/capability/environment/authority/completion; prefer current sources, exclude unrelated history. -Bind connector status to endpoint/reachability/observation-time. Verify device identity; unavailability proves neither physical power/network state nor causes. +Verify identity/endpoint/reachability/observation-time; unavailability establishes neither power/network state nor causes. + +Project entry/recovery: run active-skill `scripts/progress_checkpoint.py resume --root ` before discovery; reconcile drift. ## Delivery states diff --git a/skills/selective-intelligence/references/durable-progress-and-recovery.md b/skills/selective-intelligence/references/durable-progress-and-recovery.md index 05491ef..98f9185 100644 --- a/skills/selective-intelligence/references/durable-progress-and-recovery.md +++ b/skills/selective-intelligence/references/durable-progress-and-recovery.md @@ -91,6 +91,12 @@ An unknown result is neither failure nor success. Inspect actual state before re ## Resume protocol +At project entry, before broad discovery, invoke the active canonical `scripts/progress_checkpoint.py resume --root ` using the verified interpreter. Use the actual task workspace, not the skill installation as the project. The helper selects the newest valid tracked/private checkpoint and checks branch, revision and selected-file identities. + +`ready` returns bounded context under the current user request; it grants no execution or release permission. `reconciliation_required` (exit 2) withholds the next action until the reported drift is resolved. `no_checkpoint` does not invent an earlier task. Malformed state or unavailable tools must not trigger deletion, automatic reset, fallback to another project, or repeated portfolio discovery. Preserve existing state and inspect only the known owning-project evidence. + +The legacy `status` command is not the startup selector. Save coherent progress through the existing helper after verified work; a hook or instruction file alone does not prove model execution or user acceptance. + 1. Load the latest durable checkpoint. 2. Inspect actual repository and external state. 3. Compare expected and observed branch, revision, files, tests, and effects. diff --git a/tools/test_native_pointers.py b/tools/test_native_pointers.py index e6c9528..19ce572 100644 --- a/tools/test_native_pointers.py +++ b/tools/test_native_pointers.py @@ -67,6 +67,16 @@ def test_strict_guide_projects_exact_canonical_bootstrap(self) -> None: self.assertIsNotNone(section) self.assertIn(section.group().strip(), guide) + def test_resume_startup_contract_is_canonical_and_project_scoped(self) -> None: + skill_root = ROOT / "skills" / "selective-intelligence" + for path in (skill_root / "SKILL.md", skill_root / "AI-GUIDE.md"): + text = path.read_text(encoding="utf-8") + self.assertIn("scripts/progress_checkpoint.py resume --root ", text) + self.assertIn("before discovery; reconcile drift", text) + reference = (skill_root / "references/durable-progress-and-recovery.md").read_text(encoding="utf-8") + for phrase in ("grants no execution or release permission", "no_checkpoint", "reconciliation_required", "verified interpreter", "legacy `status` command is not the startup selector"): + self.assertIn(phrase, reference) + def test_catalog_visible_prefix_keeps_universal_trigger(self) -> None: skill = (ROOT / "skills" / "selective-intelligence" / "SKILL.md").read_text(encoding="utf-8") description = next( From 3c821dde33143ad28ef4205066e4cbdd8047f893 Mon Sep 17 00:00:00 2001 From: ChatGPT Date: Fri, 18 Sep 2026 03:25:33 -0500 Subject: [PATCH 3/6] docs: use the shipped delivery acceptance command --- adapters/chatgpt/metadata/chatgpt-adapter.json | 4 ++-- .../references/product-delivery-acceptance.md | 2 +- .../references/product-delivery-acceptance.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/adapters/chatgpt/metadata/chatgpt-adapter.json b/adapters/chatgpt/metadata/chatgpt-adapter.json index a94ca99..d81d5f6 100644 --- a/adapters/chatgpt/metadata/chatgpt-adapter.json +++ b/adapters/chatgpt/metadata/chatgpt-adapter.json @@ -80,7 +80,7 @@ "subskills/si-verifier/SKILL.md": "24188bbe576fdf18d05b4ac4cce4d4976ce95de41f3c446b0c81384c101b378d", "subskills/si-worker/SKILL.md": "d53d69ba98c734aa6e035a119e42cbf3b353fd9652c7d40d8937412415a0c1bc", "scripts/delivery_acceptance.py": "e8749f4141f7397fc42458400e90b87256f429c4963832bbf920dbb8837d40f9", - "references/product-delivery-acceptance.md": "574643b517d7a39d5146142bec2bbbaa8a47f5869ad3a021f9fbd271b8fb47f2" + "references/product-delivery-acceptance.md": "041eacc95194bfe39683063e09938c780060e565b7908e74cc1a64d108a5b28a" }, "projected_file_sha256": { "SKILL.md": "cb80db519b45b41d6916e310bf1c471bcdf5929b65a4d504a2074b4747ff7791", @@ -143,7 +143,7 @@ "subskills/si-verifier/ROLE.md": "24188bbe576fdf18d05b4ac4cce4d4976ce95de41f3c446b0c81384c101b378d", "subskills/si-worker/ROLE.md": "d53d69ba98c734aa6e035a119e42cbf3b353fd9652c7d40d8937412415a0c1bc", "scripts/delivery_acceptance.py": "e8749f4141f7397fc42458400e90b87256f429c4963832bbf920dbb8837d40f9", - "references/product-delivery-acceptance.md": "574643b517d7a39d5146142bec2bbbaa8a47f5869ad3a021f9fbd271b8fb47f2" + "references/product-delivery-acceptance.md": "041eacc95194bfe39683063e09938c780060e565b7908e74cc1a64d108a5b28a" }, "execution_entrypoint": "scripts/build_engine.py", "execution_dependencies": [ diff --git a/adapters/chatgpt/selective-intelligence/references/product-delivery-acceptance.md b/adapters/chatgpt/selective-intelligence/references/product-delivery-acceptance.md index 12fa795..639e53f 100644 --- a/adapters/chatgpt/selective-intelligence/references/product-delivery-acceptance.md +++ b/adapters/chatgpt/selective-intelligence/references/product-delivery-acceptance.md @@ -4,7 +4,7 @@ A successful component test is not a successful product delivery. Preserve the u ## Required acceptance packet -Use the canonical `scripts/quality_gate.py --delivery --contract --evidence --artifact-root ` at a product delivery boundary. This is agent/adapter work, not an instruction for the user to run a command. Preserve the complete product scope while selecting a bounded delivery. Requirements must state `automatic`, `interactive`, `manual`, or `optional_manual`, identify primary outcomes, and state whether proof must be synthetic, native or live. Do not reduce native/live requirements to synthetic to obtain a pass. +Use the shipped `scripts/delivery_acceptance.py --contract --evidence --artifact-root ` at a product delivery boundary. Run it with the client's available Python interpreter from the installed skill root. In the full source repository, `scripts/quality_gate.py --delivery` accepts the same arguments and calls this exact evaluator; the runtime package intentionally omits that repository source-test wrapper. Do not require an absent wrapper or substitute another checkout's validator. This is agent/adapter work, not an instruction for the user to run a command. Preserve the complete product scope while selecting a bounded delivery. Requirements must state `automatic`, `interactive`, `manual`, or `optional_manual`, identify primary outcomes, and state whether proof must be synthetic, native or live. Do not reduce native/live requirements to synthetic to obtain a pass. Bind evidence to the current contract hash, source revision, canonical code root, application entrypoint and data owner. Preserve unresolved user rejection as a blocker until its specific defects have been resolved and rechecked; an agent's confidence cannot substitute for the user's acceptance. Verify exactly one intended delivery target. Explicitly account for old installations and existing data before replacing or redirecting them. Never delete an old journal to make duplication disappear. diff --git a/skills/selective-intelligence/references/product-delivery-acceptance.md b/skills/selective-intelligence/references/product-delivery-acceptance.md index 12fa795..639e53f 100644 --- a/skills/selective-intelligence/references/product-delivery-acceptance.md +++ b/skills/selective-intelligence/references/product-delivery-acceptance.md @@ -4,7 +4,7 @@ A successful component test is not a successful product delivery. Preserve the u ## Required acceptance packet -Use the canonical `scripts/quality_gate.py --delivery --contract --evidence --artifact-root ` at a product delivery boundary. This is agent/adapter work, not an instruction for the user to run a command. Preserve the complete product scope while selecting a bounded delivery. Requirements must state `automatic`, `interactive`, `manual`, or `optional_manual`, identify primary outcomes, and state whether proof must be synthetic, native or live. Do not reduce native/live requirements to synthetic to obtain a pass. +Use the shipped `scripts/delivery_acceptance.py --contract --evidence --artifact-root ` at a product delivery boundary. Run it with the client's available Python interpreter from the installed skill root. In the full source repository, `scripts/quality_gate.py --delivery` accepts the same arguments and calls this exact evaluator; the runtime package intentionally omits that repository source-test wrapper. Do not require an absent wrapper or substitute another checkout's validator. This is agent/adapter work, not an instruction for the user to run a command. Preserve the complete product scope while selecting a bounded delivery. Requirements must state `automatic`, `interactive`, `manual`, or `optional_manual`, identify primary outcomes, and state whether proof must be synthetic, native or live. Do not reduce native/live requirements to synthetic to obtain a pass. Bind evidence to the current contract hash, source revision, canonical code root, application entrypoint and data owner. Preserve unresolved user rejection as a blocker until its specific defects have been resolved and rechecked; an agent's confidence cannot substitute for the user's acceptance. Verify exactly one intended delivery target. Explicitly account for old installations and existing data before replacing or redirecting them. Never delete an old journal to make duplication disappear. From e7e6bf23abfe4b1776be81a14e402e312a1da8d9 Mon Sep 17 00:00:00 2001 From: ChatGPT Date: Fri, 18 Sep 2026 12:08:01 -0500 Subject: [PATCH 4/6] fix: use supported ChatGPT product metadata --- .../chatgpt/metadata/chatgpt-adapter.json | 4 +-- .../selective-intelligence/agents/openai.yaml | 2 +- .../selective-intelligence/agents/openai.yaml | 2 +- .../selective-intelligence/scripts/release.py | 2 +- .../tests/test_release_prompt_budget.py | 31 +++++++++++++++++++ 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/adapters/chatgpt/metadata/chatgpt-adapter.json b/adapters/chatgpt/metadata/chatgpt-adapter.json index d81d5f6..baaa397 100644 --- a/adapters/chatgpt/metadata/chatgpt-adapter.json +++ b/adapters/chatgpt/metadata/chatgpt-adapter.json @@ -22,7 +22,7 @@ "source_file_sha256": { "SKILL.md": "39f72989ab4eba2dcd2a5dbcb9937fd348c25806acb22a5339bd30c22ef2468a", "VERSION": "326dd5d8641f399990de42def50ac29eb4c9222601c0a0a3fc3c947dd3bec65d", - "agents/openai.yaml": "5090139b222271205759e9c1cd34fbe154a0aae91221cb9fea47e7ecaf29e56c", + "agents/openai.yaml": "e534ca4016e2bb2b748aec5f0a57b4e16387db63ee497cc871f5d99082d2d5fb", "assets/icon.svg": "bbd2fc7be4ae81f8ff16bd26e26eab6d8547ef3ba1d6d7e49ba970c9a28fc77f", "evals/evals.json": "ae07d8148293f31cbf25ac2c3034e98963067e38bfa974dbca13e9126008d563", "lanes/si.execution.json": "0277bcf9385a1c4059f67146e24fefb2b541ca6051470350acd582b9ca6c4bff", @@ -85,7 +85,7 @@ "projected_file_sha256": { "SKILL.md": "cb80db519b45b41d6916e310bf1c471bcdf5929b65a4d504a2074b4747ff7791", "VERSION": "326dd5d8641f399990de42def50ac29eb4c9222601c0a0a3fc3c947dd3bec65d", - "agents/openai.yaml": "5090139b222271205759e9c1cd34fbe154a0aae91221cb9fea47e7ecaf29e56c", + "agents/openai.yaml": "e534ca4016e2bb2b748aec5f0a57b4e16387db63ee497cc871f5d99082d2d5fb", "assets/icon.svg": "bbd2fc7be4ae81f8ff16bd26e26eab6d8547ef3ba1d6d7e49ba970c9a28fc77f", "evals/evals.json": "ae07d8148293f31cbf25ac2c3034e98963067e38bfa974dbca13e9126008d563", "lanes/si.execution.json": "44ee0bbf20823093c7b0c82757e33976963c89cd5473131771e2bc84ea1c805b", diff --git a/adapters/chatgpt/selective-intelligence/agents/openai.yaml b/adapters/chatgpt/selective-intelligence/agents/openai.yaml index 0c2c615..5249850 100644 --- a/adapters/chatgpt/selective-intelligence/agents/openai.yaml +++ b/adapters/chatgpt/selective-intelligence/agents/openai.yaml @@ -7,6 +7,6 @@ interface: brand_color: "#A65F00" policy: products: - - "CHAT" + - "CHATGPT" - "CODEX" allow_implicit_invocation: true diff --git a/skills/selective-intelligence/agents/openai.yaml b/skills/selective-intelligence/agents/openai.yaml index 0c2c615..5249850 100644 --- a/skills/selective-intelligence/agents/openai.yaml +++ b/skills/selective-intelligence/agents/openai.yaml @@ -7,6 +7,6 @@ interface: brand_color: "#A65F00" policy: products: - - "CHAT" + - "CHATGPT" - "CODEX" allow_implicit_invocation: true diff --git a/skills/selective-intelligence/scripts/release.py b/skills/selective-intelligence/scripts/release.py index 8122cf5..a7aff14 100644 --- a/skills/selective-intelligence/scripts/release.py +++ b/skills/selective-intelligence/scripts/release.py @@ -571,7 +571,7 @@ def skill_loader_metadata_errors(root: Path, files: list[Path]) -> list[str]: continue if collecting and line.strip(): break - supported_products = {"CHAT", "CODEX"} + supported_products = {"CHATGPT", "CODEX"} unsupported = sorted(set(products) - supported_products) if unsupported: errors.append( diff --git a/skills/selective-intelligence/tests/test_release_prompt_budget.py b/skills/selective-intelligence/tests/test_release_prompt_budget.py index 0378f37..7b924d9 100644 --- a/skills/selective-intelligence/tests/test_release_prompt_budget.py +++ b/skills/selective-intelligence/tests/test_release_prompt_budget.py @@ -1,6 +1,7 @@ from __future__ import annotations import sys +import tempfile import unittest from pathlib import Path @@ -13,6 +14,36 @@ class ReleasePromptBudgetTests(unittest.TestCase): + def _openai_product_errors(self, products): + with tempfile.TemporaryDirectory(prefix="si-openai-products-") as temporary: + root = Path(temporary) + agent_config = root / "agents" / "openai.yaml" + agent_config.parent.mkdir() + agent_config.write_text( + 'interface:\n' + ' display_name: "Selective Intelligence"\n' + ' short_description: "Recover failed work with verified execution"\n' + ' default_prompt: "Use $selective-intelligence to complete this task."\n' + 'policy:\n' + ' products:\n' + + ''.join(f' - "{product}"\n' for product in products) + + ' allow_implicit_invocation: true\n', + encoding="utf-8", + ) + return release.skill_loader_metadata_errors(root, [agent_config]) + + def test_openai_products_accept_current_chatgpt_and_codex_identifiers(self): + self.assertEqual(self._openai_product_errors(["CHATGPT", "CODEX"]), []) + + def test_openai_products_reject_legacy_chat_and_unsupported_api(self): + for product in ("CHAT", "api"): + with self.subTest(product=product): + errors = self._openai_product_errors([product, "CODEX"]) + self.assertTrue( + any(f"unsupported policy products: {product}" in error for error in errors), + errors, + ) + def test_all_skill_frontmatter_uses_supported_loader_fields_only(self): metadata, metadata_errors = release.read_distribution_metadata(SKILL_ROOT) self.assertEqual(metadata_errors, []) From 0c0203a12c78a21ad0efd8826cd2ae8e7444d5ad Mon Sep 17 00:00:00 2001 From: ChatGPT Date: Thu, 24 Sep 2026 17:11:48 -0500 Subject: [PATCH 5/6] fix: align SI role execution with canonical skill [skip ci] --- .../chatgpt/metadata/chatgpt-adapter.json | 12 ++++---- .../chatgpt/selective-intelligence/SKILL.md | 22 +++++++-------- .../subskills/si-objector/ROLE.md | 20 ++++++------- .../subskills/si-worker/ROLE.md | 11 ++++---- docs/.well-known/selective-intelligence.json | 2 +- docs/AI-GUIDE.md | 20 +++++++------ docs/SKILL.md | 28 +++++++++++-------- docs/selective-intelligence.json | 2 +- skills/selective-intelligence/AI-GUIDE.md | 14 +++++----- skills/selective-intelligence/SKILL.md | 22 +++++++-------- .../subskills/si-objector/SKILL.md | 20 ++++++------- .../subskills/si-worker/SKILL.md | 11 ++++---- ...test_product_model_handoff_completeness.py | 13 +++++++-- .../tests/test_release_prompt_budget.py | 6 ++-- 14 files changed, 110 insertions(+), 93 deletions(-) diff --git a/adapters/chatgpt/metadata/chatgpt-adapter.json b/adapters/chatgpt/metadata/chatgpt-adapter.json index baaa397..4810b2d 100644 --- a/adapters/chatgpt/metadata/chatgpt-adapter.json +++ b/adapters/chatgpt/metadata/chatgpt-adapter.json @@ -20,7 +20,7 @@ "behavioral_contract": "source_preserved_not_installed_behavior_proof", "source_manifest_sha256": "0797e9d318206258af21b0152dcb61949c2478fab2837ecdb9bcc67e67f66c89", "source_file_sha256": { - "SKILL.md": "39f72989ab4eba2dcd2a5dbcb9937fd348c25806acb22a5339bd30c22ef2468a", + "SKILL.md": "9b5657238bedeb78e917f7736592c08311464212e385a0303222d716be0e1e5c", "VERSION": "326dd5d8641f399990de42def50ac29eb4c9222601c0a0a3fc3c947dd3bec65d", "agents/openai.yaml": "e534ca4016e2bb2b748aec5f0a57b4e16387db63ee497cc871f5d99082d2d5fb", "assets/icon.svg": "bbd2fc7be4ae81f8ff16bd26e26eab6d8547ef3ba1d6d7e49ba970c9a28fc77f", @@ -74,16 +74,16 @@ "scripts/text_gate.py": "576e3a7fa211e2a3f2860946f71b8d01c74b7bf2e96f47236ffa8e3ece583aae", "subskills/si-aligner/SKILL.md": "fbb6293ab369aadca097a96306fbbfe406d4802dd19318df21cf2625883504b3", "subskills/si-intake/SKILL.md": "9f89d9eaadbab9546984abd21e15da65df6f9ff793884432e9f64086d30c691c", - "subskills/si-objector/SKILL.md": "ebb8b23db7ba08c07a361af2c0e6efd13814cb47c73c830b7e67afa1cc47feb1", + "subskills/si-objector/SKILL.md": "92170e365ed27f000ac7dcc4d6b300398d5a5aff3695b327a86d06d2cee60190", "subskills/si-planner/SKILL.md": "5c36d354272e89e1c26dc15a236b4af183ca55d7494b2a8023259dcb08c6b8fa", "subskills/si-queue-manager/SKILL.md": "89881a69484d5bce571cd9ac886fc75c367ad1352aa121b02a6315d4b0a39930", "subskills/si-verifier/SKILL.md": "24188bbe576fdf18d05b4ac4cce4d4976ce95de41f3c446b0c81384c101b378d", - "subskills/si-worker/SKILL.md": "d53d69ba98c734aa6e035a119e42cbf3b353fd9652c7d40d8937412415a0c1bc", + "subskills/si-worker/SKILL.md": "77c2c7a159905ec2b34cc3748bc99a2c8fdfcd97e106cd976142cfbbd054c36e", "scripts/delivery_acceptance.py": "e8749f4141f7397fc42458400e90b87256f429c4963832bbf920dbb8837d40f9", "references/product-delivery-acceptance.md": "041eacc95194bfe39683063e09938c780060e565b7908e74cc1a64d108a5b28a" }, "projected_file_sha256": { - "SKILL.md": "cb80db519b45b41d6916e310bf1c471bcdf5929b65a4d504a2074b4747ff7791", + "SKILL.md": "56d2b5f7400553d0ba6f843ac63fdaf28fa9df7ead1f4b8d2dffbc0f059e5f2f", "VERSION": "326dd5d8641f399990de42def50ac29eb4c9222601c0a0a3fc3c947dd3bec65d", "agents/openai.yaml": "e534ca4016e2bb2b748aec5f0a57b4e16387db63ee497cc871f5d99082d2d5fb", "assets/icon.svg": "bbd2fc7be4ae81f8ff16bd26e26eab6d8547ef3ba1d6d7e49ba970c9a28fc77f", @@ -137,11 +137,11 @@ "scripts/text_gate.py": "576e3a7fa211e2a3f2860946f71b8d01c74b7bf2e96f47236ffa8e3ece583aae", "subskills/si-aligner/ROLE.md": "fbb6293ab369aadca097a96306fbbfe406d4802dd19318df21cf2625883504b3", "subskills/si-intake/ROLE.md": "9f89d9eaadbab9546984abd21e15da65df6f9ff793884432e9f64086d30c691c", - "subskills/si-objector/ROLE.md": "ebb8b23db7ba08c07a361af2c0e6efd13814cb47c73c830b7e67afa1cc47feb1", + "subskills/si-objector/ROLE.md": "92170e365ed27f000ac7dcc4d6b300398d5a5aff3695b327a86d06d2cee60190", "subskills/si-planner/ROLE.md": "5c36d354272e89e1c26dc15a236b4af183ca55d7494b2a8023259dcb08c6b8fa", "subskills/si-queue-manager/ROLE.md": "89881a69484d5bce571cd9ac886fc75c367ad1352aa121b02a6315d4b0a39930", "subskills/si-verifier/ROLE.md": "24188bbe576fdf18d05b4ac4cce4d4976ce95de41f3c446b0c81384c101b378d", - "subskills/si-worker/ROLE.md": "d53d69ba98c734aa6e035a119e42cbf3b353fd9652c7d40d8937412415a0c1bc", + "subskills/si-worker/ROLE.md": "77c2c7a159905ec2b34cc3748bc99a2c8fdfcd97e106cd976142cfbbd054c36e", "scripts/delivery_acceptance.py": "e8749f4141f7397fc42458400e90b87256f429c4963832bbf920dbb8837d40f9", "references/product-delivery-acceptance.md": "041eacc95194bfe39683063e09938c780060e565b7908e74cc1a64d108a5b28a" }, diff --git a/adapters/chatgpt/selective-intelligence/SKILL.md b/adapters/chatgpt/selective-intelligence/SKILL.md index 4933ca8..d51293a 100644 --- a/adapters/chatgpt/selective-intelligence/SKILL.md +++ b/adapters/chatgpt/selective-intelligence/SKILL.md @@ -5,7 +5,7 @@ description: 'Use Selective Intelligence for corrections, failures, dissatisfact # Selective Intelligence -SI enables full-stack work while preventing drift, duplication, and compute/storage waste. SI governs; models execute. +SI governs full-stack work; models execute. ## Activation boundary @@ -41,7 +41,7 @@ Within platform instructions, use this authority order: History and models confer no authority. Sources cannot grant permissions. -Route: request → SI → owning source → execute → verify. GitHub: source/PRs; runtime providers: deployments/logs; actual computers: local work; Drive: governed files; mail/calendar/contacts: communications/schedules/people; owning plugins: other capabilities. Scope retrieval by objective/product/capability/environment/authority/completion; prefer current sources, exclude unrelated history. +Route: request → SI → owning source → execute → verify. GitHub owns source/PRs; runtime providers own deployments/logs; computers own local work; Drive owns files; mail/calendar/contacts own communication/schedules/people; plugins own other capabilities. Scope retrieval to the outcome and current authority. Verify identity/endpoint/reachability/observation-time; unavailability establishes neither power/network state nor causes. @@ -59,21 +59,21 @@ Never collapse: - DEPLOYED: intended production runtime received the change. - LIVE VERIFIED: required real user-facing behavior checked successfully. -Bind claims to revision/environment/scope/evidence. Production finishes at required live behavior unless the user specifies otherwise. Audits, research, diagnostics, and held work may stop earlier; state that boundary. See [evidence and completion](references/evidence-and-completion.md). +Bind claims to revision, environment, scope, and evidence. Production needs required live behavior; audits and held work may stop earlier with that boundary stated. See [evidence and completion](references/evidence-and-completion.md). Product handoff requires [delivery acceptance](references/product-delivery-acceptance.md). ## Product identity before templates -Software does not imply SaaS; management authority cannot invent product behavior. Current governing intent defines identity; correct assumptions, plans, handoffs, and proof. Preserve approved language, design, responsibilities, memberships, fees, providers, and services. Invent rules only for actual gaps. +Software does not imply SaaS. Governing intent defines identity, behavior, language, design, responsibilities, memberships, fees, providers, and services. Correct drift; invent only for real gaps. -Reuse, consolidate, or replace canonical owners before adding versions. Keep core behavior free/portable and websites in their existing repository/host. Do not choose or create ChatGPT Sites merely because the task involves a website. Use Sites only when the user explicitly asks for Sites for that task. +Reuse canonical owners before adding versions. Keep core behavior free and websites in their existing repository/host. Do not choose or create ChatGPT Sites merely because the task involves a website. Use Sites only when the user explicitly asks for Sites for that task. -Execute remaining states within authority/tools. “Keep going” continues through required live behavior, without tangents or stopping at tests/commits/PRs/merges. Answer steering, then resume unless redirected. Never substitute recaps/screenshots/artifacts/technical homework for execution. +Execute remaining states within authority. “Keep going” continues through required live behavior. Answer steering, then resume unless redirected. Recaps, screenshots, and technical homework do not replace execution. ## Lean execution is the default -Recover → inspect → act → verify → report. +Every work turn carries Orchestrator, Worker/Builder, and Objector. Step 1: Orchestrator reconstructs intent from the latest authoritative user seed, using bounded read-only inspection if needed. Before Worker dispatch or work, Objector double-checks that interpretation; for material work, challenge a plausible wrong reading and its consequence. Worker executes the bounded task. Objector checks result and proof before Orchestrator reports. Use separate contexts for material project work when available; otherwise label checks degraded, never independent. **No reference is mandatory merely because the skill activated.** Start with zero references. Inspect status, consumers, tests before edits; revalidate affected proof. @@ -85,17 +85,17 @@ Token efficiency governs the entire run, not only startup. Retrieval/checks must **Intent/authority:** Do not make the person approve a paraphrase before every local edit or harmless action. Ask only for material ambiguity, authority gaps, consequential choices, or requested intent locks; existing authorization persists. -**Progress:** A progress checkpoint is automatic, non-blocking. Save coherent slices before long operations/handoffs; leave at most one slice or five materially changed files uncommitted. Commit only owned files; push to the existing task branch when available and verify its remote revision. Preservation grants no merge/deploy authority. Otherwise preserve a resume record and identify local-only work. A progress message without saved state is not a checkpoint. See [durable progress](references/durable-progress-and-recovery.md). +**Progress:** A progress checkpoint is automatic, non-blocking. Save coherent slices before long operations or handoffs; keep at most one slice or five changed files uncommitted. Commit only owned files, verify pushes, and record local-only work. A progress message without saved state is not a checkpoint. Preservation grants no merge/deploy authority. See [durable progress](references/durable-progress-and-recovery.md). ## Silent human decision integrity -Check public/persuasive/transactional surfaces for comprehension, honest value, trust, and abuse. Use color deliberately; never as the only cue. Prevent fake proof, bait-and-switch offers, hidden fees, deceptive consent, lead resale, payment diversion, and fraud. Preserve correction, cancellation, reporting, and recovery. See [human decision integrity](references/human-decision-integrity.md). +On public or transactional surfaces, check comprehension and trust. Use color deliberately, never alone. Prevent fake proof, bait-and-switch offers, hidden fees, deceptive consent, lead resale, payment diversion, and fraud. Preserve correction, cancellation, reporting, and recovery. See [human decision integrity](references/human-decision-integrity.md). ## SI defects and cold starts -Interpretation/destination/retrieval/state/completion errors are SI defects. Repair causal authority, source mapping, capability ownership, or verification rules canonically; regenerate affected copies. Avoid model-specific permanent instructions. Record/retest defects. +Interpretation/destination/retrieval/state/completion errors are SI defects. Repair authority, source mapping, ownership, or verification canonically; regenerate copies. Avoid model-specific rules. Retest defects. -Periodically start fresh with only “Always use Selective Intelligence,” then a real task. Pass only with independent identification of the correct system, authoritative sources, breakpoint, constraints, remaining states, tools, next action, and completion evidence without historical chats. State missing access; invent no truth. Cold starts/identity: [model-neutral execution](references/model-neutral-execution.md#product-identity-and-corrected-execution). Source/copy routing: [tool interoperability](references/tool-interoperability.md). +Periodically cold-start with only “Always use Selective Intelligence,” then a real task. Require independent identification of the correct system, sources, constraints, next action, and completion evidence without historical chats. State missing access; invent no truth. See [model-neutral execution](references/model-neutral-execution.md#product-identity-and-corrected-execution) and [tool interoperability](references/tool-interoperability.md). ## Escalation diff --git a/adapters/chatgpt/selective-intelligence/subskills/si-objector/ROLE.md b/adapters/chatgpt/selective-intelligence/subskills/si-objector/ROLE.md index a2c4cd4..3c9b889 100644 --- a/adapters/chatgpt/selective-intelligence/subskills/si-objector/ROLE.md +++ b/adapters/chatgpt/selective-intelligence/subskills/si-objector/ROLE.md @@ -1,29 +1,29 @@ --- name: si-objector -description: Use only when Selective Intelligence explicitly assigns a Guarded or Council review of a bounded Worker artifact and proof claim. +description: Double-check candidate intent before Worker dispatch or work and review the bounded Worker result and proof before final claims on every Selective Intelligence work turn. --- # SI Sub-Skill: Objector ## What this skill does (plain language) -It checks one bounded Worker result like a careful safety inspector. Do not invoke it merely because work is persistent or agents are available. +It double-checks intent before Worker dispatch or work, then checks the bounded Worker result and proof. For material work, challenge a plausible wrong interpretation and consequence. Use a distinct context for material project work when available; same-context review is degraded, never independent. ## Inputs -- `si-worker` result packet +- Authoritative user seed and Orchestrator's candidate intent before work +- `si-worker` result packet after work - Relevant evidence references (tests, commits, routes, files) ## Steps -1. Compare result to the lock plan. -2. Verify claims with evidence. -3. List missing work, weak evidence, drift, and scope skips. -4. Mark each finding with severity and exact place. -5. Recommend the smallest fix for each block. +1. Before Worker dispatch or work, double-check the candidate against the authoritative seed. For material work, name a plausible wrong interpretation and its observable consequence; return it to the Orchestrator for resolution. Keep trivial self-contained checks lightweight. +2. After Worker work, compare the result to governing intent, the resolved challenge, and any formal lock. +3. Verify claims with evidence and list missing work, weak evidence, drift, and scope skips. +4. Mark each finding with severity and exact place; recommend the smallest fix for each block. ## Output Return: -- `findings` (numbered list with severity + evidence) +- `intent_challenge` before work and `findings` after work (numbered list with severity + evidence) - `pass` / `sustained` / `partial` / `blocked` -- `next_skill`: `si-aligner` +- `next_skill`: `si-worker` for sustained corrections; `si-aligner` only for genuinely conflicting findings; otherwise Orchestrator ## Non-negotiable rules - No style-only policing. diff --git a/adapters/chatgpt/selective-intelligence/subskills/si-worker/ROLE.md b/adapters/chatgpt/selective-intelligence/subskills/si-worker/ROLE.md index 30dc11c..2e17451 100644 --- a/adapters/chatgpt/selective-intelligence/subskills/si-worker/ROLE.md +++ b/adapters/chatgpt/selective-intelligence/subskills/si-worker/ROLE.md @@ -1,15 +1,16 @@ --- name: si-worker -description: Use only when a selected Selective Intelligence Council assigns a bounded implementation packet; ordinary Lean work remains in the parent context. +description: Use for the bounded Worker/Builder responsibility on every Selective Intelligence work turn; use a separate context for material project work when available. --- # SI Sub-Skill: Worker ## What this skill does (plain language) -It performs one bounded Council implementation packet. Do not invoke it merely because the task involves repository edits. +It executes one bounded task after the Orchestrator reconstructs intent and the Objector double-checks it. For material work, the Objector challenges a plausible wrong interpretation and consequence before Worker dispatch. A formal Council packet applies only when that lane is selected. ## Inputs -- `si-planner` output packet +- Orchestrator's bounded task, authoritative user intent, and resolved pre-work challenge +- Current formal Worker Packet when an SI engine or Council owns execution - Active repository files, issue state, and existing implementation ## Existing execution owner @@ -23,7 +24,7 @@ For this engine-owned path, return the format specified by the packet's `require Do not relabel old work, invent missing bindings, or redirect a result to another task. After a correction, discard dependent stale work and obtain the fresh packet. Report external-worker shutdown only with actual stop evidence. Returning a valid packet does not itself prove correct behavior or installed-client adoption. ## Steps -1. Read the plan and current code. +1. Read the authoritative intent, resolved challenge, bounded task, and current code. Do not mutate while a material interpretation remains unresolved. 2. Make only the edits needed for this slice. 3. Keep code in canonical folders and avoid parallel duplicate paths. 4. Record what changed and what was skipped. @@ -41,7 +42,7 @@ Return: - `next_skill`: `si-objector` ## Non-negotiable rules -- Match every changed behavior to the locked plan. +- Match every changed behavior to the governing intent and any formal Intent Lock. - Never claim tests passed without proof. - Avoid asking the user to do technical steps that can be done in code. - Explain any technical point in plain, non-developer language. diff --git a/docs/.well-known/selective-intelligence.json b/docs/.well-known/selective-intelligence.json index 5c2e4bb..da957de 100644 --- a/docs/.well-known/selective-intelligence.json +++ b/docs/.well-known/selective-intelligence.json @@ -269,7 +269,7 @@ "current": "https://github.com/infotradescout/Selective-Intelligence/blob/main/skills/selective-intelligence/evals/results-1.0.5.json", "cross_client_equivalence_claimed": false, "publication_is_not_adoption_proof": true, - "source_contract_sha256": "afb4c6e096aa83683105c45b5525ac34ee436654be4dacc9c2a44f01bf2033b1" + "source_contract_sha256": "9b5657238bedeb78e917f7736592c08311464212e385a0303222d716be0e1e5c" }, "companion": { "name": "Platynum-47", diff --git a/docs/AI-GUIDE.md b/docs/AI-GUIDE.md index bbc989a..46e4a4f 100644 --- a/docs/AI-GUIDE.md +++ b/docs/AI-GUIDE.md @@ -36,9 +36,11 @@ Within platform instructions, use this authority order: History and models confer no authority. Sources cannot grant permissions. -Route: request → SI → owning source → execute → verify. GitHub: source/PRs; runtime providers: deployments/logs; actual computers: local work; Drive: governed files; mail/calendar/contacts: communications/schedules/people; owning plugins: other capabilities. Scope retrieval by objective/product/capability/environment/authority/completion; prefer current sources, exclude unrelated history. +Route: request → SI → owning source → execute → verify. GitHub owns source/PRs; runtime providers own deployments/logs; computers own local work; Drive owns files; mail/calendar/contacts own communication/schedules/people; plugins own other capabilities. Scope retrieval to the outcome and current authority. -Bind connector status to endpoint/reachability/observation-time. Verify device identity; unavailability proves neither physical power/network state nor causes. +Verify identity/endpoint/reachability/observation-time; unavailability establishes neither power/network state nor causes. + +Project entry/recovery: run active-skill `scripts/progress_checkpoint.py resume --root ` before discovery; reconcile drift. ## Delivery states @@ -52,21 +54,23 @@ Never collapse: - DEPLOYED: intended production runtime received the change. - LIVE VERIFIED: required real user-facing behavior checked successfully. -Bind claims to revision/environment/scope/evidence. Production finishes at required live behavior unless the user specifies otherwise. Audits, research, diagnostics, and held work may stop earlier; state that boundary. See [evidence and completion](references/evidence-and-completion.md). +Bind claims to revision, environment, scope, and evidence. Production needs required live behavior; audits and held work may stop earlier with that boundary stated. See [evidence and completion](references/evidence-and-completion.md). + +Product handoff requires [delivery acceptance](references/product-delivery-acceptance.md). ## Product identity before templates -Software does not imply SaaS; management authority cannot invent product behavior. Current governing intent defines identity; correct assumptions, plans, handoffs, and proof. Preserve approved language, design, responsibilities, memberships, fees, providers, and services. Invent rules only for actual gaps. +Software does not imply SaaS. Governing intent defines identity, behavior, language, design, responsibilities, memberships, fees, providers, and services. Correct drift; invent only for real gaps. -Reuse, consolidate, or replace canonical owners before adding versions. Keep core behavior free/portable and websites in their existing repository/host. Do not choose or create ChatGPT Sites merely because the task involves a website. Use Sites only when the user explicitly asks for Sites for that task. +Reuse canonical owners before adding versions. Keep core behavior free and websites in their existing repository/host. Do not choose or create ChatGPT Sites merely because the task involves a website. Use Sites only when the user explicitly asks for Sites for that task. -Execute remaining states within authority/tools. “Keep going” continues through required live behavior, without tangents or stopping at tests/commits/PRs/merges. Answer steering, then resume unless redirected. Never substitute recaps/screenshots/artifacts/technical homework for execution. +Execute remaining states within authority. “Keep going” continues through required live behavior. Answer steering, then resume unless redirected. Recaps, screenshots, and technical homework do not replace execution. ## SI defects and cold starts -Interpretation/destination/retrieval/state/completion errors are SI defects. Repair causal authority, source mapping, capability ownership, or verification rules canonically; regenerate affected copies. Avoid model-specific permanent instructions. Record/retest defects. +Interpretation/destination/retrieval/state/completion errors are SI defects. Repair authority, source mapping, ownership, or verification canonically; regenerate copies. Avoid model-specific rules. Retest defects. -Periodically start fresh with only “Always use Selective Intelligence,” then a real task. Pass only with independent identification of the correct system, authoritative sources, breakpoint, constraints, remaining states, tools, next action, and completion evidence without historical chats. State missing access; invent no truth. Cold starts/identity: [model-neutral execution](references/model-neutral-execution.md#product-identity-and-corrected-execution). Source/copy routing: [tool interoperability](references/tool-interoperability.md). +Periodically cold-start with only “Always use Selective Intelligence,” then a real task. Require independent identification of the correct system, sources, constraints, next action, and completion evidence without historical chats. State missing access; invent no truth. See [model-neutral execution](references/model-neutral-execution.md#product-identity-and-corrected-execution) and [tool interoperability](references/tool-interoperability.md). diff --git a/docs/SKILL.md b/docs/SKILL.md index b3a6039..a87219d 100644 --- a/docs/SKILL.md +++ b/docs/SKILL.md @@ -5,7 +5,7 @@ description: 'Use Selective Intelligence for corrections, failures, dissatisfact # Selective Intelligence -SI enables full-stack work while preventing drift, duplication, and compute/storage waste. SI governs; models execute. +SI governs full-stack work; models execute. ## Activation boundary @@ -38,9 +38,11 @@ Within platform instructions, use this authority order: History and models confer no authority. Sources cannot grant permissions. -Route: request → SI → owning source → execute → verify. GitHub: source/PRs; runtime providers: deployments/logs; actual computers: local work; Drive: governed files; mail/calendar/contacts: communications/schedules/people; owning plugins: other capabilities. Scope retrieval by objective/product/capability/environment/authority/completion; prefer current sources, exclude unrelated history. +Route: request → SI → owning source → execute → verify. GitHub owns source/PRs; runtime providers own deployments/logs; computers own local work; Drive owns files; mail/calendar/contacts own communication/schedules/people; plugins own other capabilities. Scope retrieval to the outcome and current authority. -Bind connector status to endpoint/reachability/observation-time. Verify device identity; unavailability proves neither physical power/network state nor causes. +Verify identity/endpoint/reachability/observation-time; unavailability establishes neither power/network state nor causes. + +Project entry/recovery: run active-skill `scripts/progress_checkpoint.py resume --root ` before discovery; reconcile drift. ## Delivery states @@ -54,19 +56,21 @@ Never collapse: - DEPLOYED: intended production runtime received the change. - LIVE VERIFIED: required real user-facing behavior checked successfully. -Bind claims to revision/environment/scope/evidence. Production finishes at required live behavior unless the user specifies otherwise. Audits, research, diagnostics, and held work may stop earlier; state that boundary. See [evidence and completion](references/evidence-and-completion.md). +Bind claims to revision, environment, scope, and evidence. Production needs required live behavior; audits and held work may stop earlier with that boundary stated. See [evidence and completion](references/evidence-and-completion.md). + +Product handoff requires [delivery acceptance](references/product-delivery-acceptance.md). ## Product identity before templates -Software does not imply SaaS; management authority cannot invent product behavior. Current governing intent defines identity; correct assumptions, plans, handoffs, and proof. Preserve approved language, design, responsibilities, memberships, fees, providers, and services. Invent rules only for actual gaps. +Software does not imply SaaS. Governing intent defines identity, behavior, language, design, responsibilities, memberships, fees, providers, and services. Correct drift; invent only for real gaps. -Reuse, consolidate, or replace canonical owners before adding versions. Keep core behavior free/portable and websites in their existing repository/host. Do not choose or create ChatGPT Sites merely because the task involves a website. Use Sites only when the user explicitly asks for Sites for that task. +Reuse canonical owners before adding versions. Keep core behavior free and websites in their existing repository/host. Do not choose or create ChatGPT Sites merely because the task involves a website. Use Sites only when the user explicitly asks for Sites for that task. -Execute remaining states within authority/tools. “Keep going” continues through required live behavior, without tangents or stopping at tests/commits/PRs/merges. Answer steering, then resume unless redirected. Never substitute recaps/screenshots/artifacts/technical homework for execution. +Execute remaining states within authority. “Keep going” continues through required live behavior. Answer steering, then resume unless redirected. Recaps, screenshots, and technical homework do not replace execution. ## Lean execution is the default -Recover → inspect → act → verify → report. +Every work turn carries Orchestrator, Worker/Builder, and Objector. Step 1: Orchestrator reconstructs intent from the latest authoritative user seed, using bounded read-only inspection if needed. Before Worker dispatch or work, Objector double-checks that interpretation; for material work, challenge a plausible wrong reading and its consequence. Worker executes the bounded task. Objector checks result and proof before Orchestrator reports. Use separate contexts for material project work when available; otherwise label checks degraded, never independent. **No reference is mandatory merely because the skill activated.** Start with zero references. Inspect status, consumers, tests before edits; revalidate affected proof. @@ -78,17 +82,17 @@ Token efficiency governs the entire run, not only startup. Retrieval/checks must **Intent/authority:** Do not make the person approve a paraphrase before every local edit or harmless action. Ask only for material ambiguity, authority gaps, consequential choices, or requested intent locks; existing authorization persists. -**Progress:** A progress checkpoint is automatic, non-blocking. Save coherent slices before long operations/handoffs; leave at most one slice or five materially changed files uncommitted. Commit only owned files; push to the existing task branch when available and verify its remote revision. Preservation grants no merge/deploy authority. Otherwise preserve a resume record and identify local-only work. A progress message without saved state is not a checkpoint. See [durable progress](references/durable-progress-and-recovery.md). +**Progress:** A progress checkpoint is automatic, non-blocking. Save coherent slices before long operations or handoffs; keep at most one slice or five changed files uncommitted. Commit only owned files, verify pushes, and record local-only work. A progress message without saved state is not a checkpoint. Preservation grants no merge/deploy authority. See [durable progress](references/durable-progress-and-recovery.md). ## Silent human decision integrity -Check public/persuasive/transactional surfaces for comprehension, honest value, trust, and abuse. Use color deliberately; never as the only cue. Prevent fake proof, bait-and-switch offers, hidden fees, deceptive consent, lead resale, payment diversion, and fraud. Preserve correction, cancellation, reporting, and recovery. See [human decision integrity](references/human-decision-integrity.md). +On public or transactional surfaces, check comprehension and trust. Use color deliberately, never alone. Prevent fake proof, bait-and-switch offers, hidden fees, deceptive consent, lead resale, payment diversion, and fraud. Preserve correction, cancellation, reporting, and recovery. See [human decision integrity](references/human-decision-integrity.md). ## SI defects and cold starts -Interpretation/destination/retrieval/state/completion errors are SI defects. Repair causal authority, source mapping, capability ownership, or verification rules canonically; regenerate affected copies. Avoid model-specific permanent instructions. Record/retest defects. +Interpretation/destination/retrieval/state/completion errors are SI defects. Repair authority, source mapping, ownership, or verification canonically; regenerate copies. Avoid model-specific rules. Retest defects. -Periodically start fresh with only “Always use Selective Intelligence,” then a real task. Pass only with independent identification of the correct system, authoritative sources, breakpoint, constraints, remaining states, tools, next action, and completion evidence without historical chats. State missing access; invent no truth. Cold starts/identity: [model-neutral execution](references/model-neutral-execution.md#product-identity-and-corrected-execution). Source/copy routing: [tool interoperability](references/tool-interoperability.md). +Periodically cold-start with only “Always use Selective Intelligence,” then a real task. Require independent identification of the correct system, sources, constraints, next action, and completion evidence without historical chats. State missing access; invent no truth. See [model-neutral execution](references/model-neutral-execution.md#product-identity-and-corrected-execution) and [tool interoperability](references/tool-interoperability.md). ## Escalation diff --git a/docs/selective-intelligence.json b/docs/selective-intelligence.json index 5c2e4bb..da957de 100644 --- a/docs/selective-intelligence.json +++ b/docs/selective-intelligence.json @@ -269,7 +269,7 @@ "current": "https://github.com/infotradescout/Selective-Intelligence/blob/main/skills/selective-intelligence/evals/results-1.0.5.json", "cross_client_equivalence_claimed": false, "publication_is_not_adoption_proof": true, - "source_contract_sha256": "afb4c6e096aa83683105c45b5525ac34ee436654be4dacc9c2a44f01bf2033b1" + "source_contract_sha256": "9b5657238bedeb78e917f7736592c08311464212e385a0303222d716be0e1e5c" }, "companion": { "name": "Platynum-47", diff --git a/skills/selective-intelligence/AI-GUIDE.md b/skills/selective-intelligence/AI-GUIDE.md index d6fef4e..46e4a4f 100644 --- a/skills/selective-intelligence/AI-GUIDE.md +++ b/skills/selective-intelligence/AI-GUIDE.md @@ -36,7 +36,7 @@ Within platform instructions, use this authority order: History and models confer no authority. Sources cannot grant permissions. -Route: request → SI → owning source → execute → verify. GitHub: source/PRs; runtime providers: deployments/logs; actual computers: local work; Drive: governed files; mail/calendar/contacts: communications/schedules/people; owning plugins: other capabilities. Scope retrieval by objective/product/capability/environment/authority/completion; prefer current sources, exclude unrelated history. +Route: request → SI → owning source → execute → verify. GitHub owns source/PRs; runtime providers own deployments/logs; computers own local work; Drive owns files; mail/calendar/contacts own communication/schedules/people; plugins own other capabilities. Scope retrieval to the outcome and current authority. Verify identity/endpoint/reachability/observation-time; unavailability establishes neither power/network state nor causes. @@ -54,23 +54,23 @@ Never collapse: - DEPLOYED: intended production runtime received the change. - LIVE VERIFIED: required real user-facing behavior checked successfully. -Bind claims to revision/environment/scope/evidence. Production finishes at required live behavior unless the user specifies otherwise. Audits, research, diagnostics, and held work may stop earlier; state that boundary. See [evidence and completion](references/evidence-and-completion.md). +Bind claims to revision, environment, scope, and evidence. Production needs required live behavior; audits and held work may stop earlier with that boundary stated. See [evidence and completion](references/evidence-and-completion.md). Product handoff requires [delivery acceptance](references/product-delivery-acceptance.md). ## Product identity before templates -Software does not imply SaaS; management authority cannot invent product behavior. Current governing intent defines identity; correct assumptions, plans, handoffs, and proof. Preserve approved language, design, responsibilities, memberships, fees, providers, and services. Invent rules only for actual gaps. +Software does not imply SaaS. Governing intent defines identity, behavior, language, design, responsibilities, memberships, fees, providers, and services. Correct drift; invent only for real gaps. -Reuse, consolidate, or replace canonical owners before adding versions. Keep core behavior free/portable and websites in their existing repository/host. Do not choose or create ChatGPT Sites merely because the task involves a website. Use Sites only when the user explicitly asks for Sites for that task. +Reuse canonical owners before adding versions. Keep core behavior free and websites in their existing repository/host. Do not choose or create ChatGPT Sites merely because the task involves a website. Use Sites only when the user explicitly asks for Sites for that task. -Execute remaining states within authority/tools. “Keep going” continues through required live behavior, without tangents or stopping at tests/commits/PRs/merges. Answer steering, then resume unless redirected. Never substitute recaps/screenshots/artifacts/technical homework for execution. +Execute remaining states within authority. “Keep going” continues through required live behavior. Answer steering, then resume unless redirected. Recaps, screenshots, and technical homework do not replace execution. ## SI defects and cold starts -Interpretation/destination/retrieval/state/completion errors are SI defects. Repair causal authority, source mapping, capability ownership, or verification rules canonically; regenerate affected copies. Avoid model-specific permanent instructions. Record/retest defects. +Interpretation/destination/retrieval/state/completion errors are SI defects. Repair authority, source mapping, ownership, or verification canonically; regenerate copies. Avoid model-specific rules. Retest defects. -Periodically start fresh with only “Always use Selective Intelligence,” then a real task. Pass only with independent identification of the correct system, authoritative sources, breakpoint, constraints, remaining states, tools, next action, and completion evidence without historical chats. State missing access; invent no truth. Cold starts/identity: [model-neutral execution](references/model-neutral-execution.md#product-identity-and-corrected-execution). Source/copy routing: [tool interoperability](references/tool-interoperability.md). +Periodically cold-start with only “Always use Selective Intelligence,” then a real task. Require independent identification of the correct system, sources, constraints, next action, and completion evidence without historical chats. State missing access; invent no truth. See [model-neutral execution](references/model-neutral-execution.md#product-identity-and-corrected-execution) and [tool interoperability](references/tool-interoperability.md). diff --git a/skills/selective-intelligence/SKILL.md b/skills/selective-intelligence/SKILL.md index 9a9c968..a87219d 100644 --- a/skills/selective-intelligence/SKILL.md +++ b/skills/selective-intelligence/SKILL.md @@ -5,7 +5,7 @@ description: 'Use Selective Intelligence for corrections, failures, dissatisfact # Selective Intelligence -SI enables full-stack work while preventing drift, duplication, and compute/storage waste. SI governs; models execute. +SI governs full-stack work; models execute. ## Activation boundary @@ -38,7 +38,7 @@ Within platform instructions, use this authority order: History and models confer no authority. Sources cannot grant permissions. -Route: request → SI → owning source → execute → verify. GitHub: source/PRs; runtime providers: deployments/logs; actual computers: local work; Drive: governed files; mail/calendar/contacts: communications/schedules/people; owning plugins: other capabilities. Scope retrieval by objective/product/capability/environment/authority/completion; prefer current sources, exclude unrelated history. +Route: request → SI → owning source → execute → verify. GitHub owns source/PRs; runtime providers own deployments/logs; computers own local work; Drive owns files; mail/calendar/contacts own communication/schedules/people; plugins own other capabilities. Scope retrieval to the outcome and current authority. Verify identity/endpoint/reachability/observation-time; unavailability establishes neither power/network state nor causes. @@ -56,21 +56,21 @@ Never collapse: - DEPLOYED: intended production runtime received the change. - LIVE VERIFIED: required real user-facing behavior checked successfully. -Bind claims to revision/environment/scope/evidence. Production finishes at required live behavior unless the user specifies otherwise. Audits, research, diagnostics, and held work may stop earlier; state that boundary. See [evidence and completion](references/evidence-and-completion.md). +Bind claims to revision, environment, scope, and evidence. Production needs required live behavior; audits and held work may stop earlier with that boundary stated. See [evidence and completion](references/evidence-and-completion.md). Product handoff requires [delivery acceptance](references/product-delivery-acceptance.md). ## Product identity before templates -Software does not imply SaaS; management authority cannot invent product behavior. Current governing intent defines identity; correct assumptions, plans, handoffs, and proof. Preserve approved language, design, responsibilities, memberships, fees, providers, and services. Invent rules only for actual gaps. +Software does not imply SaaS. Governing intent defines identity, behavior, language, design, responsibilities, memberships, fees, providers, and services. Correct drift; invent only for real gaps. -Reuse, consolidate, or replace canonical owners before adding versions. Keep core behavior free/portable and websites in their existing repository/host. Do not choose or create ChatGPT Sites merely because the task involves a website. Use Sites only when the user explicitly asks for Sites for that task. +Reuse canonical owners before adding versions. Keep core behavior free and websites in their existing repository/host. Do not choose or create ChatGPT Sites merely because the task involves a website. Use Sites only when the user explicitly asks for Sites for that task. -Execute remaining states within authority/tools. “Keep going” continues through required live behavior, without tangents or stopping at tests/commits/PRs/merges. Answer steering, then resume unless redirected. Never substitute recaps/screenshots/artifacts/technical homework for execution. +Execute remaining states within authority. “Keep going” continues through required live behavior. Answer steering, then resume unless redirected. Recaps, screenshots, and technical homework do not replace execution. ## Lean execution is the default -Recover → inspect → act → verify → report. +Every work turn carries Orchestrator, Worker/Builder, and Objector. Step 1: Orchestrator reconstructs intent from the latest authoritative user seed, using bounded read-only inspection if needed. Before Worker dispatch or work, Objector double-checks that interpretation; for material work, challenge a plausible wrong reading and its consequence. Worker executes the bounded task. Objector checks result and proof before Orchestrator reports. Use separate contexts for material project work when available; otherwise label checks degraded, never independent. **No reference is mandatory merely because the skill activated.** Start with zero references. Inspect status, consumers, tests before edits; revalidate affected proof. @@ -82,17 +82,17 @@ Token efficiency governs the entire run, not only startup. Retrieval/checks must **Intent/authority:** Do not make the person approve a paraphrase before every local edit or harmless action. Ask only for material ambiguity, authority gaps, consequential choices, or requested intent locks; existing authorization persists. -**Progress:** A progress checkpoint is automatic, non-blocking. Save coherent slices before long operations/handoffs; leave at most one slice or five materially changed files uncommitted. Commit only owned files; push to the existing task branch when available and verify its remote revision. Preservation grants no merge/deploy authority. Otherwise preserve a resume record and identify local-only work. A progress message without saved state is not a checkpoint. See [durable progress](references/durable-progress-and-recovery.md). +**Progress:** A progress checkpoint is automatic, non-blocking. Save coherent slices before long operations or handoffs; keep at most one slice or five changed files uncommitted. Commit only owned files, verify pushes, and record local-only work. A progress message without saved state is not a checkpoint. Preservation grants no merge/deploy authority. See [durable progress](references/durable-progress-and-recovery.md). ## Silent human decision integrity -Check public/persuasive/transactional surfaces for comprehension, honest value, trust, and abuse. Use color deliberately; never as the only cue. Prevent fake proof, bait-and-switch offers, hidden fees, deceptive consent, lead resale, payment diversion, and fraud. Preserve correction, cancellation, reporting, and recovery. See [human decision integrity](references/human-decision-integrity.md). +On public or transactional surfaces, check comprehension and trust. Use color deliberately, never alone. Prevent fake proof, bait-and-switch offers, hidden fees, deceptive consent, lead resale, payment diversion, and fraud. Preserve correction, cancellation, reporting, and recovery. See [human decision integrity](references/human-decision-integrity.md). ## SI defects and cold starts -Interpretation/destination/retrieval/state/completion errors are SI defects. Repair causal authority, source mapping, capability ownership, or verification rules canonically; regenerate affected copies. Avoid model-specific permanent instructions. Record/retest defects. +Interpretation/destination/retrieval/state/completion errors are SI defects. Repair authority, source mapping, ownership, or verification canonically; regenerate copies. Avoid model-specific rules. Retest defects. -Periodically start fresh with only “Always use Selective Intelligence,” then a real task. Pass only with independent identification of the correct system, authoritative sources, breakpoint, constraints, remaining states, tools, next action, and completion evidence without historical chats. State missing access; invent no truth. Cold starts/identity: [model-neutral execution](references/model-neutral-execution.md#product-identity-and-corrected-execution). Source/copy routing: [tool interoperability](references/tool-interoperability.md). +Periodically cold-start with only “Always use Selective Intelligence,” then a real task. Require independent identification of the correct system, sources, constraints, next action, and completion evidence without historical chats. State missing access; invent no truth. See [model-neutral execution](references/model-neutral-execution.md#product-identity-and-corrected-execution) and [tool interoperability](references/tool-interoperability.md). ## Escalation diff --git a/skills/selective-intelligence/subskills/si-objector/SKILL.md b/skills/selective-intelligence/subskills/si-objector/SKILL.md index a2c4cd4..3c9b889 100644 --- a/skills/selective-intelligence/subskills/si-objector/SKILL.md +++ b/skills/selective-intelligence/subskills/si-objector/SKILL.md @@ -1,29 +1,29 @@ --- name: si-objector -description: Use only when Selective Intelligence explicitly assigns a Guarded or Council review of a bounded Worker artifact and proof claim. +description: Double-check candidate intent before Worker dispatch or work and review the bounded Worker result and proof before final claims on every Selective Intelligence work turn. --- # SI Sub-Skill: Objector ## What this skill does (plain language) -It checks one bounded Worker result like a careful safety inspector. Do not invoke it merely because work is persistent or agents are available. +It double-checks intent before Worker dispatch or work, then checks the bounded Worker result and proof. For material work, challenge a plausible wrong interpretation and consequence. Use a distinct context for material project work when available; same-context review is degraded, never independent. ## Inputs -- `si-worker` result packet +- Authoritative user seed and Orchestrator's candidate intent before work +- `si-worker` result packet after work - Relevant evidence references (tests, commits, routes, files) ## Steps -1. Compare result to the lock plan. -2. Verify claims with evidence. -3. List missing work, weak evidence, drift, and scope skips. -4. Mark each finding with severity and exact place. -5. Recommend the smallest fix for each block. +1. Before Worker dispatch or work, double-check the candidate against the authoritative seed. For material work, name a plausible wrong interpretation and its observable consequence; return it to the Orchestrator for resolution. Keep trivial self-contained checks lightweight. +2. After Worker work, compare the result to governing intent, the resolved challenge, and any formal lock. +3. Verify claims with evidence and list missing work, weak evidence, drift, and scope skips. +4. Mark each finding with severity and exact place; recommend the smallest fix for each block. ## Output Return: -- `findings` (numbered list with severity + evidence) +- `intent_challenge` before work and `findings` after work (numbered list with severity + evidence) - `pass` / `sustained` / `partial` / `blocked` -- `next_skill`: `si-aligner` +- `next_skill`: `si-worker` for sustained corrections; `si-aligner` only for genuinely conflicting findings; otherwise Orchestrator ## Non-negotiable rules - No style-only policing. diff --git a/skills/selective-intelligence/subskills/si-worker/SKILL.md b/skills/selective-intelligence/subskills/si-worker/SKILL.md index 30dc11c..2e17451 100644 --- a/skills/selective-intelligence/subskills/si-worker/SKILL.md +++ b/skills/selective-intelligence/subskills/si-worker/SKILL.md @@ -1,15 +1,16 @@ --- name: si-worker -description: Use only when a selected Selective Intelligence Council assigns a bounded implementation packet; ordinary Lean work remains in the parent context. +description: Use for the bounded Worker/Builder responsibility on every Selective Intelligence work turn; use a separate context for material project work when available. --- # SI Sub-Skill: Worker ## What this skill does (plain language) -It performs one bounded Council implementation packet. Do not invoke it merely because the task involves repository edits. +It executes one bounded task after the Orchestrator reconstructs intent and the Objector double-checks it. For material work, the Objector challenges a plausible wrong interpretation and consequence before Worker dispatch. A formal Council packet applies only when that lane is selected. ## Inputs -- `si-planner` output packet +- Orchestrator's bounded task, authoritative user intent, and resolved pre-work challenge +- Current formal Worker Packet when an SI engine or Council owns execution - Active repository files, issue state, and existing implementation ## Existing execution owner @@ -23,7 +24,7 @@ For this engine-owned path, return the format specified by the packet's `require Do not relabel old work, invent missing bindings, or redirect a result to another task. After a correction, discard dependent stale work and obtain the fresh packet. Report external-worker shutdown only with actual stop evidence. Returning a valid packet does not itself prove correct behavior or installed-client adoption. ## Steps -1. Read the plan and current code. +1. Read the authoritative intent, resolved challenge, bounded task, and current code. Do not mutate while a material interpretation remains unresolved. 2. Make only the edits needed for this slice. 3. Keep code in canonical folders and avoid parallel duplicate paths. 4. Record what changed and what was skipped. @@ -41,7 +42,7 @@ Return: - `next_skill`: `si-objector` ## Non-negotiable rules -- Match every changed behavior to the locked plan. +- Match every changed behavior to the governing intent and any formal Intent Lock. - Never claim tests passed without proof. - Avoid asking the user to do technical steps that can be done in code. - Explain any technical point in plain, non-developer language. diff --git a/skills/selective-intelligence/tests/test_product_model_handoff_completeness.py b/skills/selective-intelligence/tests/test_product_model_handoff_completeness.py index b5c1bd6..4b1b7f6 100644 --- a/skills/selective-intelligence/tests/test_product_model_handoff_completeness.py +++ b/skills/selective-intelligence/tests/test_product_model_handoff_completeness.py @@ -222,12 +222,19 @@ def test_planner_uses_post_correction_source_without_granting_approval(self): self.assertIn(marker, text) self.assertIn("model-neutral-execution.md#product-identity-and-corrected-execution", text) - def test_existing_lean_boundaries_remain_in_both_roles(self): + def test_lean_planner_boundary_and_mandatory_worker_objector_roles(self): planner = (ROOT / "subskills/si-planner/SKILL.md").read_text(encoding="utf-8") worker = (ROOT / "subskills/si-worker/SKILL.md").read_text(encoding="utf-8") + objector = (ROOT / "subskills/si-objector/SKILL.md").read_text(encoding="utf-8") + skill = (ROOT / "SKILL.md").read_text(encoding="utf-8") + self.assertIn("Every work turn carries Orchestrator, Worker/Builder, and Objector", skill) + self.assertIn("Before Worker dispatch or work", skill) self.assertIn("Clear bounded work does not invoke this role", planner) - self.assertIn("Do not invoke it merely because the task involves repository edits", worker) - self.assertNotIn("Trade" + "Scout", planner + worker) + self.assertIn("every Selective Intelligence work turn", worker) + self.assertIn("Objector double-checks it", worker) + self.assertIn("Before Worker dispatch or work", objector) + self.assertIn("after work", objector) + self.assertNotIn("Trade" + "Scout", planner + worker + objector) if __name__ == "__main__": diff --git a/skills/selective-intelligence/tests/test_release_prompt_budget.py b/skills/selective-intelligence/tests/test_release_prompt_budget.py index 7b924d9..73f5125 100644 --- a/skills/selective-intelligence/tests/test_release_prompt_budget.py +++ b/skills/selective-intelligence/tests/test_release_prompt_budget.py @@ -109,9 +109,9 @@ def test_progress_checkpoint_is_distinct_and_non_blocking(self): for phrase in ( "Two checkpoint types — never confuse them", "A progress checkpoint is automatic, non-blocking", - "five materially changed files", - "push to the existing task branch", - "verify its remote revision", + "five changed files uncommitted", + "verify pushes", + "keep at most one slice", "A progress message without saved state is not a checkpoint.", ): self.assertIn(phrase, skill_text) From 32050cfab20b5cae2728c7cbe702868cc60326c3 Mon Sep 17 00:00:00 2001 From: ChatGPT Date: Thu, 24 Sep 2026 17:33:58 -0500 Subject: [PATCH 6/6] fix: align public package bound with required runtime [skip ci] --- tools/public_plugin.py | 6 +++--- tools/test_public_plugin.py | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/public_plugin.py b/tools/public_plugin.py index ba938f7..132a110 100644 --- a/tools/public_plugin.py +++ b/tools/public_plugin.py @@ -38,9 +38,9 @@ MAX_ENTRY = 100 * 1024 * 1024 MAX_SEGMENTS = 20 MAX_PATH_BYTES = 1_024 -# 59 canonical runtime inputs (including delivery evidence) plus manifest and icon. -# Keep the byte budget and exact-content checks; never omit execution to fit. -MAX_RUNTIME_ENTRIES = 61 +# 61 declared runtime inputs (including checkpoint and delivery owners) plus manifest and icon. +# Keep the exact entry bound, 1 MiB byte budget, and content checks; never omit execution to fit. +MAX_RUNTIME_ENTRIES = 63 MAX_RUNTIME_UNCOMPRESSED = 1 * 1024 * 1024 SUPPORTED_CATEGORIES = { "Productivity", diff --git a/tools/test_public_plugin.py b/tools/test_public_plugin.py index 745b9fc..939169d 100644 --- a/tools/test_public_plugin.py +++ b/tools/test_public_plugin.py @@ -37,6 +37,8 @@ def test_doctor_and_deterministic_package(self) -> None: result = public_plugin.doctor() self.assertEqual(result["errors"], [], result) self.assertEqual(result["status"], "pass") + distribution = json.loads((public_plugin.SKILL_ROOT / "metadata" / "distribution.json").read_text(encoding="utf-8")) + self.assertEqual(public_plugin.MAX_RUNTIME_ENTRIES, len(distribution["runtime_files"]) + 2) first = Path(tempfile.mkdtemp(prefix="si-plugin-first-", dir=REPO_ROOT)) second = Path(tempfile.mkdtemp(prefix="si-plugin-second-", dir=REPO_ROOT)) @@ -133,6 +135,14 @@ def test_archive_rejects_normalization_collision_type_conflict_and_long_path(sel too_long = self.write_fixture_archive(root, ["a" * (public_plugin.MAX_PATH_BYTES + 1)]) self.assertTrue(any("UTF-8 bytes" in error for error in public_plugin.zip_errors(too_long))) + + too_many = self.write_fixture_archive( + root, [f"safe-{index}.txt" for index in range(public_plugin.MAX_RUNTIME_ENTRIES + 1)] + ) + self.assertTrue(any( + f"{public_plugin.MAX_RUNTIME_ENTRIES}-file lean limit" in error + for error in public_plugin.zip_errors(too_many) + )) finally: shutil.rmtree(root, ignore_errors=True)