honestenv 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- honestenv/__init__.py +5 -0
- honestenv/cli.py +152 -0
- honestenv/gates/__init__.py +1 -0
- honestenv/gates/baseline.py +138 -0
- honestenv/gates/lint.py +11 -0
- honestenv/gates/run.py +16 -0
- honestenv/gates/schema.py +39 -0
- honestenv/harbor_cli.py +57 -0
- honestenv/package.py +38 -0
- honestenv/scaffold.py +110 -0
- honestenv/types.py +31 -0
- honestenv-0.1.0.dist-info/METADATA +170 -0
- honestenv-0.1.0.dist-info/RECORD +17 -0
- honestenv-0.1.0.dist-info/WHEEL +5 -0
- honestenv-0.1.0.dist-info/entry_points.txt +2 -0
- honestenv-0.1.0.dist-info/licenses/LICENSE +201 -0
- honestenv-0.1.0.dist-info/top_level.txt +1 -0
honestenv/__init__.py
ADDED
honestenv/cli.py
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import json
|
|
3
|
+
import shutil
|
|
4
|
+
import sys
|
|
5
|
+
import tomllib
|
|
6
|
+
from datetime import datetime, timezone
|
|
7
|
+
from dataclasses import asdict
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
from . import __version__
|
|
11
|
+
from .gates.baseline import check_baseline
|
|
12
|
+
from .gates.lint import check_lint
|
|
13
|
+
from .gates.run import check_agent
|
|
14
|
+
from .gates.schema import check_schema
|
|
15
|
+
from .package import load
|
|
16
|
+
from .scaffold import init_task
|
|
17
|
+
from .types import CheckReport
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def check_task(task_dir: Path, *, static_only: bool = False) -> CheckReport:
|
|
21
|
+
package = load(task_dir)
|
|
22
|
+
gates = [check_schema(package), check_lint(package), check_baseline(package)]
|
|
23
|
+
if not static_only:
|
|
24
|
+
gates.extend([
|
|
25
|
+
check_agent(package, agent="oracle", expected_reward=1.0),
|
|
26
|
+
check_agent(package, agent="nop", expected_reward=0.0),
|
|
27
|
+
])
|
|
28
|
+
report = CheckReport(package, gates, all(gate.passed for gate in gates))
|
|
29
|
+
print(f"{package.root}: {'passed' if report.passed else 'failed'}")
|
|
30
|
+
for gate in gates:
|
|
31
|
+
print(f" {gate.name}: {'passed' if gate.passed else 'failed'} - {gate.details}")
|
|
32
|
+
return report
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def read_manifest(dataset: Path) -> dict:
|
|
36
|
+
path = dataset / "dataset-manifest.json"
|
|
37
|
+
try:
|
|
38
|
+
manifest = json.loads(path.read_text(encoding="utf-8"))
|
|
39
|
+
if not isinstance(manifest, dict) or set(manifest) != {"tasks"} or not isinstance(manifest["tasks"], dict):
|
|
40
|
+
raise ValueError("expected an object with a tasks object")
|
|
41
|
+
for name, entry in manifest["tasks"].items():
|
|
42
|
+
if not isinstance(name, str) or name in ("", ".", "..") or Path(name).name != name or "\\" in name:
|
|
43
|
+
raise ValueError("invalid task directory name")
|
|
44
|
+
if not isinstance(entry, dict) or set(entry) != {"content_sha256", "schema_version", "checked_at", "honestenv_version"}:
|
|
45
|
+
raise ValueError(f"invalid entry for {name}")
|
|
46
|
+
if any(not isinstance(value, str) or not value for value in entry.values()):
|
|
47
|
+
raise ValueError(f"invalid entry for {name}")
|
|
48
|
+
digest = entry["content_sha256"]
|
|
49
|
+
if len(digest) != 64 or any(character not in "0123456789abcdef" for character in digest):
|
|
50
|
+
raise ValueError(f"invalid content hash for {name}")
|
|
51
|
+
timestamp = entry["checked_at"]
|
|
52
|
+
if not timestamp.endswith("Z") or datetime.fromisoformat(timestamp[:-1] + "+00:00").utcoffset() != timezone.utc.utcoffset(None):
|
|
53
|
+
raise ValueError(f"invalid check timestamp for {name}")
|
|
54
|
+
return manifest
|
|
55
|
+
except (OSError, ValueError) as error:
|
|
56
|
+
raise ValueError(f"invalid or missing manifest {path}: {error}") from error
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def verify_pack(dataset: Path) -> None:
|
|
60
|
+
manifest = read_manifest(dataset)
|
|
61
|
+
for name, entry in manifest["tasks"].items():
|
|
62
|
+
task = dataset / name
|
|
63
|
+
package = load(task)
|
|
64
|
+
with (task / "task.toml").open("rb") as task_file:
|
|
65
|
+
schema_version = tomllib.load(task_file)["schema_version"]
|
|
66
|
+
if schema_version != entry["schema_version"]:
|
|
67
|
+
raise ValueError(f"schema version mismatch for {name}")
|
|
68
|
+
if package.content_hash != entry["content_sha256"]:
|
|
69
|
+
raise ValueError(f"content hash mismatch for {name}")
|
|
70
|
+
for task in dataset.iterdir():
|
|
71
|
+
if task.is_dir() and (task / "task.toml").is_file() and task.name not in manifest["tasks"]:
|
|
72
|
+
raise ValueError(f"unlisted task directory: {task.name}")
|
|
73
|
+
print(f"{dataset}: verified")
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def run() -> int:
|
|
77
|
+
parser = argparse.ArgumentParser(prog="honestenv")
|
|
78
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
79
|
+
|
|
80
|
+
init_parser = subparsers.add_parser(
|
|
81
|
+
"init", help="Create a task scaffold in tasks/<task>",
|
|
82
|
+
description="Create tasks/<task> in the current directory. An existing empty directory is allowed; a non-empty directory requires --force.",
|
|
83
|
+
)
|
|
84
|
+
init_parser.add_argument("name", metavar="org/task", help="Harbor name org/task; each part starts with an ASCII letter or digit and contains only letters, digits, dots, hyphens, or underscores, without ..")
|
|
85
|
+
init_parser.add_argument("--force", action="store_true", help="Overwrite scaffold files in an existing task directory")
|
|
86
|
+
|
|
87
|
+
check_parser = subparsers.add_parser("check", help="Check a task directory")
|
|
88
|
+
check_parser.add_argument("task_dir", type=Path)
|
|
89
|
+
check_parser.add_argument("--out", type=Path)
|
|
90
|
+
check_parser.add_argument("--static-only", action="store_true", help="Run schema, lint and factory checks only")
|
|
91
|
+
|
|
92
|
+
test_parser = subparsers.add_parser("test-gates", help="Check tasks in tasks/")
|
|
93
|
+
test_parser.add_argument("--static-only", action="store_true")
|
|
94
|
+
|
|
95
|
+
pack_parser = subparsers.add_parser("pack", help="Copy a passing task into a dataset")
|
|
96
|
+
pack_parser.add_argument("task_dir", type=Path)
|
|
97
|
+
pack_parser.add_argument("--into", type=Path, required=True)
|
|
98
|
+
|
|
99
|
+
verify_parser = subparsers.add_parser("verify-pack", help="Verify a dataset manifest and its tasks")
|
|
100
|
+
verify_parser.add_argument("dataset_dir", type=Path)
|
|
101
|
+
|
|
102
|
+
args = parser.parse_args()
|
|
103
|
+
try:
|
|
104
|
+
if args.command == "init":
|
|
105
|
+
print(init_task(args.name, force=args.force))
|
|
106
|
+
return 0
|
|
107
|
+
|
|
108
|
+
if args.command == "verify-pack":
|
|
109
|
+
verify_pack(args.dataset_dir)
|
|
110
|
+
return 0
|
|
111
|
+
|
|
112
|
+
if args.command == "test-gates":
|
|
113
|
+
tasks_dir = Path("tasks")
|
|
114
|
+
reports = [
|
|
115
|
+
check_task(task_dir, static_only=args.static_only)
|
|
116
|
+
for task_dir in sorted(tasks_dir.iterdir())
|
|
117
|
+
if task_dir.is_dir() and (task_dir / "task.toml").is_file()
|
|
118
|
+
]
|
|
119
|
+
return 0 if all(report.passed for report in reports) else 1
|
|
120
|
+
|
|
121
|
+
report = check_task(args.task_dir, static_only=args.command == "check" and args.static_only)
|
|
122
|
+
if args.command == "check":
|
|
123
|
+
if args.out is not None:
|
|
124
|
+
args.out.write_text(json.dumps(asdict(report), default=str, indent=2) + "\n", encoding="utf-8")
|
|
125
|
+
elif report.passed:
|
|
126
|
+
args.into.mkdir(parents=True, exist_ok=True)
|
|
127
|
+
destination = args.into / report.package.root.name
|
|
128
|
+
manifest_path = args.into / "dataset-manifest.json"
|
|
129
|
+
manifest = read_manifest(args.into) if manifest_path.exists() else {"tasks": {}}
|
|
130
|
+
with (report.package.root / "task.toml").open("rb") as task_file:
|
|
131
|
+
schema_version = tomllib.load(task_file)["schema_version"]
|
|
132
|
+
shutil.copytree(report.package.root, destination)
|
|
133
|
+
manifest["tasks"][destination.name] = {
|
|
134
|
+
"content_sha256": load(destination).content_hash,
|
|
135
|
+
"schema_version": schema_version,
|
|
136
|
+
"checked_at": datetime.now(timezone.utc).isoformat().replace("+00:00", "Z"),
|
|
137
|
+
"honestenv_version": __version__,
|
|
138
|
+
}
|
|
139
|
+
manifest_path.write_text(json.dumps(manifest, indent=2) + "\n", encoding="utf-8")
|
|
140
|
+
print(destination)
|
|
141
|
+
return 0 if report.passed else 1
|
|
142
|
+
except (OSError, ValueError, KeyError) as error:
|
|
143
|
+
print(f"honestenv: {error}", file=sys.stderr)
|
|
144
|
+
return 1
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def main() -> None:
|
|
148
|
+
sys.exit(run())
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
if __name__ == "__main__":
|
|
152
|
+
main()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Quality gate interfaces."""
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"""Static factory policy checks independent of Harbor.
|
|
2
|
+
|
|
3
|
+
Headroom Policy: verifier.timeout_sec must be finite, positive, and at least
|
|
4
|
+
15 seconds. When metadata.expected_oracle_runtime_sec is finite and positive,
|
|
5
|
+
the timeout must also be at least three times that expected runtime.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import ipaddress
|
|
9
|
+
import math
|
|
10
|
+
import re
|
|
11
|
+
import tomllib
|
|
12
|
+
from urllib.parse import urlsplit
|
|
13
|
+
|
|
14
|
+
from ..types import GateReport, TaskPackage
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
PIN = re.compile(r"@sha256:[0-9a-fA-F]{64}$")
|
|
18
|
+
REWARD_ONE = re.compile(r"\b(?:echo\s+['\"]?1(?:\.0+)?['\"]?|printf\s+['\"]?1(?:\.0+)?(?:\\n)?['\"]?)\s*(?:>|\|)")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def check_baseline(package: TaskPackage) -> GateReport:
|
|
22
|
+
violations = []
|
|
23
|
+
try:
|
|
24
|
+
with (package.root / "task.toml").open("rb") as task_file:
|
|
25
|
+
config = tomllib.load(task_file)
|
|
26
|
+
except (OSError, UnicodeError, tomllib.TOMLDecodeError):
|
|
27
|
+
return GateReport("factory", False, "Cannot parse task.toml")
|
|
28
|
+
|
|
29
|
+
def table(name):
|
|
30
|
+
value = config.get(name, {})
|
|
31
|
+
return value if isinstance(value, dict) else {}
|
|
32
|
+
|
|
33
|
+
environment = table("environment")
|
|
34
|
+
agent = table("agent")
|
|
35
|
+
verifier = table("verifier")
|
|
36
|
+
metadata = table("metadata")
|
|
37
|
+
image = environment.get("docker_image")
|
|
38
|
+
if image is not None and (not isinstance(image, str) or not PIN.search(image) or image.startswith("@")):
|
|
39
|
+
violations.append("image: environment.docker_image must be digest-pinned")
|
|
40
|
+
|
|
41
|
+
dockerfiles = []
|
|
42
|
+
for name in ("environment/Dockerfile", "tests/Dockerfile"):
|
|
43
|
+
path = package.root / name
|
|
44
|
+
if not path.is_file():
|
|
45
|
+
continue
|
|
46
|
+
try:
|
|
47
|
+
contents = path.read_text(encoding="utf-8")
|
|
48
|
+
except (OSError, UnicodeError):
|
|
49
|
+
violations.append(f"image: cannot read {name}")
|
|
50
|
+
continue
|
|
51
|
+
dockerfiles.append((name, contents))
|
|
52
|
+
stages = set()
|
|
53
|
+
for line in contents.splitlines():
|
|
54
|
+
match = re.match(r"\s*FROM\s+(?:--\S+\s+)*(\S+)(?:\s+AS\s+(\S+))?", line, re.I)
|
|
55
|
+
if match:
|
|
56
|
+
reference, stage = match.groups()
|
|
57
|
+
if reference.lower() != "scratch" and reference.lower() not in stages and (not PIN.search(reference) or reference.startswith("@")):
|
|
58
|
+
violations.append(f"image: {name} FROM {reference} must be digest-pinned")
|
|
59
|
+
if stage:
|
|
60
|
+
stages.add(stage.lower())
|
|
61
|
+
if re.search(r"--network(?:=|\s+)host\b", contents, re.I):
|
|
62
|
+
violations.append(f"network: {name} uses host networking")
|
|
63
|
+
|
|
64
|
+
if verifier.get("environment_mode") != "separate":
|
|
65
|
+
violations.append('verifier: environment_mode must be explicitly "separate"')
|
|
66
|
+
mode = agent.get("network_mode", environment.get("network_mode", "public"))
|
|
67
|
+
if mode == "allowlist":
|
|
68
|
+
hosts = environment.get("allowed_hosts")
|
|
69
|
+
if not isinstance(hosts, list) or not hosts or any(not isinstance(host, str) or not host.strip() or host.strip() in {"*", "0.0.0.0/0", "::/0"} for host in hosts):
|
|
70
|
+
violations.append("network: allowlist must contain restricted allowed_hosts")
|
|
71
|
+
elif mode != "no-network":
|
|
72
|
+
violations.append("network: effective agent policy must be restricted")
|
|
73
|
+
|
|
74
|
+
def positive_number(value):
|
|
75
|
+
return isinstance(value, (int, float)) and not isinstance(value, bool) and math.isfinite(value) and value > 0
|
|
76
|
+
|
|
77
|
+
timeout = verifier.get("timeout_sec")
|
|
78
|
+
expected = metadata.get("expected_oracle_runtime_sec")
|
|
79
|
+
if not positive_number(timeout) or timeout < 15:
|
|
80
|
+
violations.append("headroom: verifier.timeout_sec must be finite and at least 15 seconds")
|
|
81
|
+
elif positive_number(expected) and timeout < 3 * expected:
|
|
82
|
+
violations.append("headroom: verifier.timeout_sec must be at least three times expected oracle runtime")
|
|
83
|
+
|
|
84
|
+
user = agent.get("user")
|
|
85
|
+
if not isinstance(user, (str, int)) or isinstance(user, bool) or str(user).strip().lower() in {"", "root", "0"}:
|
|
86
|
+
violations.append("agent: user must be present and non-root")
|
|
87
|
+
|
|
88
|
+
script_path = package.root / "tests/test.sh"
|
|
89
|
+
try:
|
|
90
|
+
script = script_path.read_text(encoding="utf-8")
|
|
91
|
+
except (OSError, UnicodeError):
|
|
92
|
+
script = ""
|
|
93
|
+
violations.append("reward: cannot read tests/test.sh")
|
|
94
|
+
|
|
95
|
+
for name, contents in dockerfiles + [("tests/test.sh", script)]:
|
|
96
|
+
for line in contents.splitlines():
|
|
97
|
+
if line.lstrip().startswith("#") or not re.search(r"\b(?:curl|wget|git\s+clone|fetch|httpie)\b", line, re.I):
|
|
98
|
+
continue
|
|
99
|
+
urls = re.findall(r"(?:https?|git|ssh)://[^\s'\";]+", line, re.I)
|
|
100
|
+
for url in urls:
|
|
101
|
+
host = urlsplit(url).hostname
|
|
102
|
+
try:
|
|
103
|
+
local = host is not None and ipaddress.ip_address(host).is_loopback
|
|
104
|
+
except ValueError:
|
|
105
|
+
local = host is not None and host.lower() == "localhost"
|
|
106
|
+
if not local:
|
|
107
|
+
violations.append(f"test-network: {name} fetches a public host")
|
|
108
|
+
if not urls:
|
|
109
|
+
target = re.search(r"\b(?:curl|wget|fetch|httpie|git\s+clone)\s+(?:-\S+\s+)*([^\s;]+)", line, re.I)
|
|
110
|
+
if target:
|
|
111
|
+
host = target.group(1).split("/", 1)[0].split(":", 1)[0].split("@")[-1]
|
|
112
|
+
try:
|
|
113
|
+
local = ipaddress.ip_address(host.strip("[]")).is_loopback
|
|
114
|
+
except ValueError:
|
|
115
|
+
local = host.lower() == "localhost"
|
|
116
|
+
if not local:
|
|
117
|
+
violations.append(f"test-network: {name} fetches a public host")
|
|
118
|
+
|
|
119
|
+
rewards = list(REWARD_ONE.finditer(script))
|
|
120
|
+
artifacts = config.get("artifacts", [])
|
|
121
|
+
artifacts = artifacts if isinstance(artifacts, list) else []
|
|
122
|
+
references_artifact = any(isinstance(item, str) and (item in script or item.rsplit("/", 1)[-1].removesuffix(".py") in script) for item in artifacts)
|
|
123
|
+
if not rewards:
|
|
124
|
+
violations.append("reward: no reward 1 write found")
|
|
125
|
+
else:
|
|
126
|
+
for reward in rewards:
|
|
127
|
+
before = script[:reward.start()]
|
|
128
|
+
condition = re.search(r"\bif\b((?:(?!\bfi\b).)*?)\bthen\b(?:(?!\b(?:fi|else|elif)\b).)*$", before, re.S)
|
|
129
|
+
if not condition or not any(isinstance(item, str) and (item in condition.group(1) or item.rsplit("/", 1)[-1].removesuffix(".py") in condition.group(1)) for item in artifacts):
|
|
130
|
+
violations.append("reward: reward 1 is not conditional on a check of a packaged artifact")
|
|
131
|
+
if re.search(r"\bexit\s+[1-9][0-9]*\b", script[reward.end():]):
|
|
132
|
+
violations.append("reward: reward 1 can be followed by a non-zero exit")
|
|
133
|
+
if not references_artifact:
|
|
134
|
+
violations.append("reward: test does not reference a packaged artifact")
|
|
135
|
+
if re.search(r"\$\{?RANDOM\}?|/dev/(?:u?random)|\b(?:import random|from random import|random\.)|\b(?:date|time\.time|datetime\.now)\b", script):
|
|
136
|
+
violations.append("reward: nondeterministic test material")
|
|
137
|
+
|
|
138
|
+
return GateReport("factory", not violations, "; ".join(violations) if violations else "Factory policy checks passed")
|
honestenv/gates/lint.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from .. import harbor_cli
|
|
2
|
+
from ..types import GateReport, TaskPackage
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def check_lint(package: TaskPackage) -> GateReport:
|
|
6
|
+
result = harbor_cli.lint(package.root)
|
|
7
|
+
return GateReport(
|
|
8
|
+
name="lint",
|
|
9
|
+
passed=result.returncode == 0,
|
|
10
|
+
details=result.stderr or result.stdout,
|
|
11
|
+
)
|
honestenv/gates/run.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from .. import harbor_cli
|
|
2
|
+
from ..types import GateReport, TaskPackage
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def check_agent(package: TaskPackage, *, agent: str, expected_reward: float) -> GateReport:
|
|
6
|
+
result = harbor_cli.run(package.root, agent=agent)
|
|
7
|
+
if result.returncode != 0:
|
|
8
|
+
details = f"Harbor exited with status {result.returncode}: {result.stderr or result.stdout}"
|
|
9
|
+
return GateReport(agent, False, details)
|
|
10
|
+
if result.reward is None:
|
|
11
|
+
return GateReport(agent, False, "Missing or invalid reward")
|
|
12
|
+
return GateReport(
|
|
13
|
+
agent,
|
|
14
|
+
result.reward == expected_reward,
|
|
15
|
+
f"Reward {result.reward}; expected {expected_reward}",
|
|
16
|
+
)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import tomllib
|
|
2
|
+
|
|
3
|
+
from ..types import GateReport, TaskPackage
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def check_schema(package: TaskPackage) -> GateReport:
|
|
7
|
+
root = package.root
|
|
8
|
+
for relative_path in ("instruction.md", "task.toml", "tests/test.sh", "solution/solve.sh"):
|
|
9
|
+
if not (root / relative_path).is_file():
|
|
10
|
+
return GateReport("schema", False, f"Missing {relative_path}")
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
instruction = (root / "instruction.md").read_text(encoding="utf-8")
|
|
14
|
+
except (OSError, UnicodeError):
|
|
15
|
+
return GateReport("schema", False, "Cannot read instruction.md")
|
|
16
|
+
if not instruction.strip():
|
|
17
|
+
return GateReport("schema", False, "instruction.md is empty")
|
|
18
|
+
|
|
19
|
+
try:
|
|
20
|
+
with (root / "task.toml").open("rb") as task_file:
|
|
21
|
+
config = tomllib.load(task_file)
|
|
22
|
+
except (OSError, UnicodeError, tomllib.TOMLDecodeError):
|
|
23
|
+
return GateReport("schema", False, "Cannot parse task.toml")
|
|
24
|
+
|
|
25
|
+
if config.get("schema_version") != "1.4":
|
|
26
|
+
return GateReport("schema", False, 'schema_version must be "1.4"')
|
|
27
|
+
|
|
28
|
+
if not (root / "environment/Dockerfile").is_file():
|
|
29
|
+
environment = config.get("environment", {})
|
|
30
|
+
docker_image = environment.get("docker_image") if isinstance(environment, dict) else None
|
|
31
|
+
if not isinstance(docker_image, str) or not docker_image.strip():
|
|
32
|
+
return GateReport("schema", False, "Missing environment/Dockerfile or environment.docker_image")
|
|
33
|
+
|
|
34
|
+
if "verifier" in config:
|
|
35
|
+
verifier = config["verifier"]
|
|
36
|
+
if not isinstance(verifier, dict) or verifier.get("environment_mode") != "separate":
|
|
37
|
+
return GateReport("schema", False, 'verifier.environment_mode must be "separate"')
|
|
38
|
+
|
|
39
|
+
return GateReport("schema", True, "Task schema is valid")
|
honestenv/harbor_cli.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import math
|
|
3
|
+
import subprocess
|
|
4
|
+
import tempfile
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from .types import CommandResult
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def lint(task_dir: Path, *, extend_select_all: bool = True) -> CommandResult:
|
|
11
|
+
argv = ["harbor", "lint"]
|
|
12
|
+
if extend_select_all:
|
|
13
|
+
argv.extend(["--extend-select", "ALL"])
|
|
14
|
+
argv.append(str(task_dir))
|
|
15
|
+
|
|
16
|
+
result = subprocess.run(argv, capture_output=True, text=True, check=False)
|
|
17
|
+
return CommandResult(
|
|
18
|
+
argv=argv,
|
|
19
|
+
returncode=result.returncode,
|
|
20
|
+
stdout=result.stdout,
|
|
21
|
+
stderr=result.stderr,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def read_reward(jobs_dir: Path) -> float | int | None:
|
|
26
|
+
# Harbor 0.27.0 persists individual trial results separately from job summaries.
|
|
27
|
+
result_paths = list(jobs_dir.glob("*/*/result.json"))
|
|
28
|
+
if len(result_paths) != 1:
|
|
29
|
+
return None
|
|
30
|
+
try:
|
|
31
|
+
result = json.loads(result_paths[0].read_text(encoding="utf-8"))
|
|
32
|
+
except (OSError, UnicodeError, ValueError):
|
|
33
|
+
return None
|
|
34
|
+
if not isinstance(result, dict) or result.get("reward_valid") is not True:
|
|
35
|
+
return None
|
|
36
|
+
verifier = result.get("verifier_result")
|
|
37
|
+
rewards = verifier.get("rewards") if isinstance(verifier, dict) else None
|
|
38
|
+
reward = rewards.get("reward") if isinstance(rewards, dict) else None
|
|
39
|
+
if type(reward) is int or (type(reward) is float and math.isfinite(reward)):
|
|
40
|
+
return reward
|
|
41
|
+
return None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def run(task_dir: Path, *, agent: str) -> CommandResult:
|
|
45
|
+
with tempfile.TemporaryDirectory(prefix="honestenv-jobs-") as directory:
|
|
46
|
+
argv = [
|
|
47
|
+
"harbor", "run", "-p", str(task_dir), "-a", agent, "-e", "docker",
|
|
48
|
+
"--jobs-dir", directory, "--yes",
|
|
49
|
+
]
|
|
50
|
+
result = subprocess.run(argv, capture_output=True, text=True, check=False)
|
|
51
|
+
return CommandResult(
|
|
52
|
+
argv=argv,
|
|
53
|
+
returncode=result.returncode,
|
|
54
|
+
stdout=result.stdout,
|
|
55
|
+
stderr=result.stderr,
|
|
56
|
+
reward=read_reward(Path(directory)),
|
|
57
|
+
)
|
honestenv/package.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Load tasks and hash their files.
|
|
2
|
+
|
|
3
|
+
SHA-256 covers files in sorted relative POSIX path order. For each file, the
|
|
4
|
+
UTF-8 path and file bytes are each preceded by their 8-byte big-endian length.
|
|
5
|
+
The recorded digest is lowercase hexadecimal.
|
|
6
|
+
"""
|
|
7
|
+
import hashlib
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
from .types import TaskPackage
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def load(path: Path) -> TaskPackage:
|
|
14
|
+
root = path.resolve(strict=True)
|
|
15
|
+
if not root.is_dir():
|
|
16
|
+
raise NotADirectoryError(root)
|
|
17
|
+
|
|
18
|
+
package = TaskPackage(root=root, content_hash="")
|
|
19
|
+
package.content_hash = content_hash(package)
|
|
20
|
+
return package
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def content_hash(package: TaskPackage) -> str:
|
|
24
|
+
digest = hashlib.sha256()
|
|
25
|
+
relative_paths = sorted(
|
|
26
|
+
path.relative_to(package.root).as_posix()
|
|
27
|
+
for path in package.root.rglob("*")
|
|
28
|
+
if path.is_file()
|
|
29
|
+
)
|
|
30
|
+
for relative_path in relative_paths:
|
|
31
|
+
path_bytes = relative_path.encode("utf-8")
|
|
32
|
+
file_bytes = (package.root / relative_path).read_bytes()
|
|
33
|
+
# Length prefixes keep paths and file contents unambiguous.
|
|
34
|
+
digest.update(len(path_bytes).to_bytes(8, "big"))
|
|
35
|
+
digest.update(path_bytes)
|
|
36
|
+
digest.update(len(file_bytes).to_bytes(8, "big"))
|
|
37
|
+
digest.update(file_bytes)
|
|
38
|
+
return digest.hexdigest()
|
honestenv/scaffold.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
IMAGE = "python:3.12-slim@sha256:191083cdf6c7bda8c76158983163ead5d5cf7b77cf3033e805bb0f5296f51b4b"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def init_task(name: str, *, force: bool = False) -> Path:
|
|
9
|
+
if not re.fullmatch(r"[a-zA-Z0-9][a-zA-Z0-9._-]*/[a-zA-Z0-9][a-zA-Z0-9._-]*", name) or ".." in name:
|
|
10
|
+
raise ValueError(
|
|
11
|
+
"Task name must be org/task, using letters, digits, dots, hyphens and underscores; "
|
|
12
|
+
"each part must start with a letter or digit and cannot contain '..'"
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
destination = Path("tasks") / name.split("/")[1]
|
|
16
|
+
if destination.parent.is_symlink() or destination.is_symlink():
|
|
17
|
+
raise OSError(f"Refusing to write through a symbolic link: {destination}")
|
|
18
|
+
if destination.exists() and any(destination.iterdir()) and not force:
|
|
19
|
+
raise FileExistsError(f"{destination} is not empty; use --force to overwrite scaffold files")
|
|
20
|
+
|
|
21
|
+
files = {
|
|
22
|
+
"instruction.md": """# Repair the rectangle area calculation
|
|
23
|
+
|
|
24
|
+
Fix `rectangle_area(width, height)` in `/app/area.py`. Both arguments are
|
|
25
|
+
non-negative integers. Return the integer area of the rectangle, including
|
|
26
|
+
zero when either dimension is zero. Preserve the function name and argument
|
|
27
|
+
order and leave the corrected source at `/app/area.py`.
|
|
28
|
+
""",
|
|
29
|
+
"task.toml": f'''schema_version = "1.4"
|
|
30
|
+
artifacts = ["/app/area.py"]
|
|
31
|
+
|
|
32
|
+
[task]
|
|
33
|
+
name = "{name}"
|
|
34
|
+
|
|
35
|
+
[metadata]
|
|
36
|
+
difficulty = "easy"
|
|
37
|
+
category = "programming"
|
|
38
|
+
tags = ["python", "program-repair"]
|
|
39
|
+
|
|
40
|
+
[verifier]
|
|
41
|
+
environment_mode = "separate"
|
|
42
|
+
timeout_sec = 30.0
|
|
43
|
+
|
|
44
|
+
[agent]
|
|
45
|
+
timeout_sec = 120.0
|
|
46
|
+
user = "agent"
|
|
47
|
+
|
|
48
|
+
[environment]
|
|
49
|
+
network_mode = "no-network"
|
|
50
|
+
cpus = 1
|
|
51
|
+
memory_mb = 512
|
|
52
|
+
storage_mb = 1024
|
|
53
|
+
''',
|
|
54
|
+
"environment/Dockerfile": f"""FROM {IMAGE}
|
|
55
|
+
|
|
56
|
+
RUN useradd --create-home agent
|
|
57
|
+
WORKDIR /app
|
|
58
|
+
COPY --chown=agent:agent area.py /app/area.py
|
|
59
|
+
RUN chown agent:agent /app
|
|
60
|
+
""",
|
|
61
|
+
"environment/area.py": """def rectangle_area(width: int, height: int) -> int:
|
|
62
|
+
return width + height
|
|
63
|
+
""",
|
|
64
|
+
"tests/Dockerfile": f"""FROM {IMAGE}
|
|
65
|
+
|
|
66
|
+
WORKDIR /app
|
|
67
|
+
COPY test.sh /tests/test.sh
|
|
68
|
+
""",
|
|
69
|
+
"tests/test.sh": """#!/bin/sh
|
|
70
|
+
set -eu
|
|
71
|
+
|
|
72
|
+
mkdir -p /logs/verifier
|
|
73
|
+
echo 0 > /logs/verifier/reward.txt
|
|
74
|
+
|
|
75
|
+
if python - <<'PYTHON'
|
|
76
|
+
import sys
|
|
77
|
+
|
|
78
|
+
sys.path.insert(0, "/app")
|
|
79
|
+
from area import rectangle_area
|
|
80
|
+
|
|
81
|
+
for width, height in [(0, 5), (7, 0), (1, 1), (2, 3), (10, 8)]:
|
|
82
|
+
actual = rectangle_area(width, height)
|
|
83
|
+
assert type(actual) is int and actual == width * height
|
|
84
|
+
PYTHON
|
|
85
|
+
then
|
|
86
|
+
echo 1.0 > /logs/verifier/reward.txt
|
|
87
|
+
fi
|
|
88
|
+
""",
|
|
89
|
+
"solution/solve.sh": """#!/bin/sh
|
|
90
|
+
set -eu
|
|
91
|
+
|
|
92
|
+
cat > /app/area.py <<'PYTHON'
|
|
93
|
+
def rectangle_area(width: int, height: int) -> int:
|
|
94
|
+
return width * height
|
|
95
|
+
PYTHON
|
|
96
|
+
""",
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
for relative_path in files:
|
|
100
|
+
path = destination / relative_path
|
|
101
|
+
if path.parent.is_symlink() or path.is_symlink():
|
|
102
|
+
raise OSError(f"Refusing to write through a symbolic link: {path}")
|
|
103
|
+
|
|
104
|
+
for relative_path, content in files.items():
|
|
105
|
+
path = destination / relative_path
|
|
106
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
107
|
+
path.write_text(content, encoding="utf-8")
|
|
108
|
+
if path.suffix == ".sh":
|
|
109
|
+
path.chmod(0o755)
|
|
110
|
+
return destination
|
honestenv/types.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@dataclass
|
|
6
|
+
class TaskPackage:
|
|
7
|
+
root: Path
|
|
8
|
+
content_hash: str
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass
|
|
12
|
+
class GateReport:
|
|
13
|
+
name: str
|
|
14
|
+
passed: bool
|
|
15
|
+
details: str
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass
|
|
19
|
+
class CheckReport:
|
|
20
|
+
package: TaskPackage
|
|
21
|
+
gates: list[GateReport]
|
|
22
|
+
passed: bool
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass
|
|
26
|
+
class CommandResult:
|
|
27
|
+
argv: list[str]
|
|
28
|
+
returncode: int
|
|
29
|
+
stdout: str
|
|
30
|
+
stderr: str
|
|
31
|
+
reward: float | int | None = None
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: honestenv
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Harbor-compatible factory for verifiable agent tasks
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://github.com/EZfan/honestenv
|
|
7
|
+
Project-URL: Repository, https://github.com/EZfan/honestenv
|
|
8
|
+
Project-URL: Issues, https://github.com/EZfan/honestenv/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/EZfan/honestenv/blob/main/CHANGELOG.md
|
|
10
|
+
Keywords: Harbor,evaluation tasks,quality gates
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Requires-Python: >=3.12
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: harbor==0.27.0
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
21
|
+
# honestenv
|
|
22
|
+
|
|
23
|
+
Verifiable agent tasks, checked before they ship.
|
|
24
|
+
|
|
25
|
+
honestenv is a Harbor-compatible factory for verifiable agent tasks. Its core is
|
|
26
|
+
quality gates and owned task packs, not an agent framework.
|
|
27
|
+
|
|
28
|
+
[](https://github.com/EZfan/honestenv/actions/workflows/ci.yml)   
|
|
29
|
+
|
|
30
|
+
Checkable training and evaluation tasks are scarce. [Harbor](https://docs.harborframework.com/) provides the task format and runtime; honestenv owns the gates that check tasks and the packs that contain them.
|
|
31
|
+
|
|
32
|
+
## Quickstart
|
|
33
|
+
|
|
34
|
+
With Python 3.12 or newer, once the package is published, install it with either:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
pip install honestenv
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
uv tool install honestenv
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
To install from a checkout:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
git clone https://github.com/EZfan/honestenv.git
|
|
48
|
+
cd honestenv
|
|
49
|
+
pip install -e .
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Create a task skeleton and run its static gates:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
honestenv init my-org/my-task
|
|
56
|
+
honestenv check tasks/my-task --static-only
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Run the static gates on all local tasks:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
honestenv test-gates --static-only
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Full checks require Docker and Docker Compose. Check the first task and copy it into a new dataset directory:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
honestenv check tasks/reservation-window --out report.json
|
|
69
|
+
honestenv pack tasks/reservation-window --into dataset
|
|
70
|
+
honestenv verify-pack dataset
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The original deterministic tasks are [`tasks/reservation-window`](tasks/reservation-window), [`tasks/version-compare`](tasks/version-compare), [`tasks/invoice-cents`](tasks/invoice-cents), [`tasks/cut-field`](tasks/cut-field), [`tasks/bind-config`](tasks/bind-config), [`tasks/quoted-csv`](tasks/quoted-csv), [`tasks/text-normalize`](tasks/text-normalize), [`tasks/record-sort`](tasks/record-sort), [`tasks/job-order`](tasks/job-order), and [`tasks/date-shift`](tasks/date-shift). All use Harbor schema 1.4.
|
|
74
|
+
|
|
75
|
+
## CLI
|
|
76
|
+
|
|
77
|
+
- `honestenv init <org/task> [--force]` writes a task skeleton to `tasks/<task>` in the current directory and records `org/task` as the task name. Each component must start with a letter or digit and contain only ASCII letters, digits, dots, hyphens, and underscores. Neither component may contain `..`. An existing empty directory can be used. A non-empty destination requires `--force`, which may overwrite its files.
|
|
78
|
+
- `honestenv check <task-dir> [--static-only] [--out report.json]` runs schema checks, factory policy checks, `harbor lint --extend-select ALL`, and official Docker-backed `harbor run` checks. The built-in solution agent (`-a oracle`) must return a valid reward of exactly 1.0, and the empty agent (`-a nop`) must return a valid reward of exactly 0.0. With `--static-only`, it skips the runtime checks. The command optionally writes a JSON report.
|
|
79
|
+
- `honestenv test-gates [--static-only]` runs the same checks for every task under `tasks/`. With `--static-only`, it runs schema, factory policy, and lint checks.
|
|
80
|
+
- `honestenv pack <task-dir> --into <dataset-dir>` runs the full check, including runtime gates, and copies the task into the dataset. It refuses to pack if checks fail or if the destination task directory already exists. It writes or updates `dataset-manifest.json` in the dataset.
|
|
81
|
+
- `honestenv verify-pack <dataset-dir>` checks the manifest, task hashes, schema versions, and unlisted task directories without running Harbor or Docker. The recorded tool version is provenance and need not match the running version.
|
|
82
|
+
|
|
83
|
+
The manifest is a JSON object with a `tasks` object keyed by task directory name.
|
|
84
|
+
Each entry contains `content_sha256`, `schema_version`, `checked_at` (UTC
|
|
85
|
+
ISO-8601 ending in `Z`), and `honestenv_version`. The content hash is SHA-256
|
|
86
|
+
over task files in sorted relative POSIX path order. For each file, the UTF-8
|
|
87
|
+
path and file bytes are each preceded by their length as an 8-byte big-endian
|
|
88
|
+
integer. The digest is lowercase hexadecimal.
|
|
89
|
+
|
|
90
|
+
## CI
|
|
91
|
+
|
|
92
|
+
Repositories with tasks in `tasks/` can call the reusable workflow. Replace both
|
|
93
|
+
`<ref>` values with the same commit SHA or tag of this repository:
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
jobs:
|
|
97
|
+
honestenv:
|
|
98
|
+
permissions:
|
|
99
|
+
contents: read
|
|
100
|
+
pull-requests: write
|
|
101
|
+
uses: EZfan/honestenv/.github/workflows/honestenv-check.yml@<ref>
|
|
102
|
+
with:
|
|
103
|
+
honestenv-ref: <ref>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The workflow checks out the caller's repository and the specified honestenv ref.
|
|
107
|
+
Its `test` job installs honestenv, runs the caller's Python unit tests in `tests/`,
|
|
108
|
+
and runs static gates on all shipped tasks. Its `runtime` job runs official
|
|
109
|
+
Docker-backed Harbor gates. On pull requests it compares changes since the merge base with the base SHA:
|
|
110
|
+
changes under a shipped `tasks/<name>/` select that task; changes under `src/`,
|
|
111
|
+
`pyproject.toml`, `.github/workflows/`, or `.github/actions/` select all tasks.
|
|
112
|
+
Other changes skip runtime gates. Pushes to main run all tasks. Only directories
|
|
113
|
+
under `tasks/` containing `task.toml` are shipped tasks; canary fixtures are not.
|
|
114
|
+
|
|
115
|
+
On pull requests, the runtime job posts or updates a Markdown checkup with each
|
|
116
|
+
task's schema, lint, factory, and runtime results. Unchanged tasks have runtime
|
|
117
|
+
marked skipped. It uses the default `GITHUB_TOKEN`; grant `contents: read` and
|
|
118
|
+
`pull-requests: write` to the calling job. Fork pull requests may receive a
|
|
119
|
+
read-only token, so their checkup comment may be unavailable.
|
|
120
|
+
|
|
121
|
+
A reusable workflow's checks are named `<caller-job> / test` and
|
|
122
|
+
`<caller-job> / runtime`. To keep exact check names `test` and `runtime`, compose
|
|
123
|
+
the actions as steps in your own jobs instead:
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
jobs:
|
|
127
|
+
test:
|
|
128
|
+
runs-on: ubuntu-latest
|
|
129
|
+
steps:
|
|
130
|
+
- uses: actions/checkout@v7
|
|
131
|
+
- uses: EZfan/honestenv/.github/actions/test@<ref>
|
|
132
|
+
runtime:
|
|
133
|
+
runs-on: ubuntu-latest
|
|
134
|
+
timeout-minutes: 30
|
|
135
|
+
permissions:
|
|
136
|
+
contents: read
|
|
137
|
+
pull-requests: write
|
|
138
|
+
steps:
|
|
139
|
+
- uses: actions/checkout@v7
|
|
140
|
+
with:
|
|
141
|
+
fetch-depth: 0
|
|
142
|
+
- uses: EZfan/honestenv/.github/actions/runtime@<ref>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Use a commit SHA or tag for each `<ref>`. The runtime action requires full Git
|
|
146
|
+
history to compare the PR base. This repository uses these composite actions in
|
|
147
|
+
its own `test` and `runtime` jobs. A standalone action repository may come later.
|
|
148
|
+
|
|
149
|
+
## Factory policy
|
|
150
|
+
|
|
151
|
+
Factory checks require digest-pinned images in Dockerfiles and `environment.docker_image`, an explicit separate verifier, a non-root agent user, and a restricted agent network policy. Set `environment.network_mode` to `"no-network"`, or use a non-empty restricted allowlist. The agent can override the environment policy. Dockerfiles must not use host networking, and test material must not fetch from public hosts. Reward scripts are checked for obvious unconditional rewards, failure exits, nondeterminism, and missing checks of packaged artifacts. These static checks are heuristics; runtime gates still check the oracle and empty agent.
|
|
152
|
+
|
|
153
|
+
The intentionally invalid packages in `tests/fixtures/bad_tasks/` verify that the
|
|
154
|
+
factory gates reject bad tasks. They are not part of the shipped `tasks/` pack.
|
|
155
|
+
|
|
156
|
+
The Headroom Policy requires an explicit, finite `verifier.timeout_sec` of at least 15 seconds. If `metadata.expected_oracle_runtime_sec` is a finite positive number, the timeout must also be at least three times that value.
|
|
157
|
+
|
|
158
|
+
## Status
|
|
159
|
+
|
|
160
|
+
Version 0.1.0 includes static and Docker-backed runtime gates, task initialization, packing and pack verification, incremental CI checks, and ten shipped tasks.
|
|
161
|
+
|
|
162
|
+
Releases use the `publish.yml` Trusted Publisher workflow and the `pypi` environment.
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
[Apache-2.0](LICENSE).
|
|
167
|
+
|
|
168
|
+
## Project links
|
|
169
|
+
|
|
170
|
+
[Contributing](CONTRIBUTING.md) | [Changelog](CHANGELOG.md) | [Security](SECURITY.md) | [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
honestenv/__init__.py,sha256=PFkF_X4oepq4fBy92r6mG0utD6uWTsbiwCtqD2UdCck,167
|
|
2
|
+
honestenv/cli.py,sha256=rWSZxWo3LB_RYELZGM_Lzf9nhOVK2Vp8II4PhILZjc4,7178
|
|
3
|
+
honestenv/harbor_cli.py,sha256=Vnc351Bw5UL7gTEUH2k9Msd0gc_5RaoCrHBZvSZ61_M,1970
|
|
4
|
+
honestenv/package.py,sha256=VeLOa59_9QHR8OTsQDzOZwl79pS7auaGhpFyXWhH8dw,1252
|
|
5
|
+
honestenv/scaffold.py,sha256=7QRAcwj_CsgoLFCs9VM5iighYoM7iSFXOlQrjPVpSW4,3148
|
|
6
|
+
honestenv/types.py,sha256=iZoScyaEvnssgZUsOx8zI0rKy7XSoqQQAEZsezdUuJI,453
|
|
7
|
+
honestenv/gates/__init__.py,sha256=EDqn0jMgCOTXWFYuhXjiHgNHs488kFVjvva6gNOLjX4,31
|
|
8
|
+
honestenv/gates/baseline.py,sha256=0lB4BxbvqdM4wujiBVFHzOz_5D1cjcCrlU_50xm3VlM,7037
|
|
9
|
+
honestenv/gates/lint.py,sha256=YAzAmVTeYier88zjhsLsOZ5iRNiORmhYO20Dqn4JMQ0,304
|
|
10
|
+
honestenv/gates/run.py,sha256=WCfM_rpg2LwUsBbv328RCPxg53vYO8ajA5fE5Gvn57Q,648
|
|
11
|
+
honestenv/gates/schema.py,sha256=9guKRAkyy3ymzS9Lx5M_1MCRkqi2CdqkBcehI2bBo8Y,1732
|
|
12
|
+
honestenv-0.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
13
|
+
honestenv-0.1.0.dist-info/METADATA,sha256=NAxllzwc6T1DKFI1aB1OBM_ZdtGrEWYLr3KoPesz4Zs,8609
|
|
14
|
+
honestenv-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
15
|
+
honestenv-0.1.0.dist-info/entry_points.txt,sha256=3gnY2fCZNGdrvstZnvJmr3b5-oaCdBw_t9-hI_vC96k,49
|
|
16
|
+
honestenv-0.1.0.dist-info/top_level.txt,sha256=femwKmw5v8XxI7cA1BNd96z0d_7okNoM6HLYMrMRccg,10
|
|
17
|
+
honestenv-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
honestenv
|