a48e4a5b6a
The template catalog is now Example 1-4: one stage, two stages (handoff), feedback loop (runner-owned limits, retries, timeout) and human decision (type=human approve/revise/abort with notify hooks). All read-only or leave changes uncommitted; none commits, pushes or deploys. A brand-new database (schema created by this Open) gets the examples once at server start, bound to the configured default model and harness. A server_settings marker records the decision, so removed examples never come back and existing installs are marked without any pipeline being added or rewritten.
22 lines
855 B
Python
22 lines
855 B
Python
from pathlib import Path
|
|
import tarfile
|
|
import tempfile
|
|
import unittest
|
|
import package
|
|
|
|
|
|
class PackageTests(unittest.TestCase):
|
|
def test_source_archive_excludes_runtime_and_credentials(self):
|
|
with tempfile.TemporaryDirectory() as directory:
|
|
archive = package.package(directory, "test", "source")
|
|
with tarfile.open(archive) as tar:
|
|
names = tar.getnames()
|
|
self.assertTrue(any(name.endswith("install.sh") for name in names))
|
|
self.assertTrue(any(name.endswith("examples/one-stage.md") for name in names))
|
|
self.assertFalse(any("/secrets/" in name or name.endswith(".db") or "/.env" in name or "/__pycache__/" in name for name in names))
|
|
self.assertTrue(archive.with_suffix(archive.suffix + ".sha256").exists())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|