agentic-engineering-harness 0.6.28 → 0.7.0
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.
- package/dist/agents/permissions.js +9 -6
- package/dist/agents/permissions.js.map +1 -1
- package/dist/cli.js +35 -14
- package/dist/cli.js.map +1 -1
- package/dist/context/compression/headroom.d.ts +6 -0
- package/dist/context/compression/headroom.js +61 -15
- package/dist/context/compression/headroom.js.map +1 -1
- package/dist/context/compression/types.d.ts +1 -0
- package/dist/context/envelope.js +1 -1
- package/dist/context/envelope.js.map +1 -1
- package/dist/context/gateway.d.ts +2 -1
- package/dist/context/gateway.js +77 -41
- package/dist/context/gateway.js.map +1 -1
- package/dist/context/policy.js +1 -1
- package/dist/context/policy.js.map +1 -1
- package/dist/context/preflight.js +10 -4
- package/dist/context/preflight.js.map +1 -1
- package/dist/context/repository/graphify.d.ts +1 -0
- package/dist/context/repository/graphify.js +4 -33
- package/dist/context/repository/graphify.js.map +1 -1
- package/dist/context/repository/serena.d.ts +1 -1
- package/dist/context/repository/serena.js +2 -1
- package/dist/context/repository/serena.js.map +1 -1
- package/dist/context/transport.d.ts +33 -0
- package/dist/context/transport.js +63 -0
- package/dist/context/transport.js.map +1 -0
- package/dist/context/types.d.ts +19 -1
- package/dist/context/types.js +1 -1
- package/dist/context/types.js.map +1 -1
- package/dist/core/config.js +6 -8
- package/dist/core/config.js.map +1 -1
- package/dist/core/doctor.js +6 -6
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/init.js +2 -1
- package/dist/core/init.js.map +1 -1
- package/dist/core/run.js +37 -14
- package/dist/core/run.js.map +1 -1
- package/dist/core/types.d.ts +30 -0
- package/dist/core/verify.d.ts +2 -0
- package/dist/core/verify.js +3 -2
- package/dist/core/verify.js.map +1 -1
- package/dist/evals/fullStack.d.ts +20 -0
- package/dist/evals/fullStack.js +138 -0
- package/dist/evals/fullStack.js.map +1 -0
- package/dist/evidence/graph.js +24 -7
- package/dist/evidence/graph.js.map +1 -1
- package/dist/memory/candidates.d.ts +29 -0
- package/dist/memory/candidates.js +31 -0
- package/dist/memory/candidates.js.map +1 -0
- package/dist/paseo/launchSpec.js +4 -4
- package/dist/paseo/launchSpec.js.map +1 -1
- package/dist/provenance/generate.d.ts +34 -0
- package/dist/provenance/generate.js +209 -41
- package/dist/provenance/generate.js.map +1 -1
- package/dist/providers/engram.d.ts +27 -1
- package/dist/providers/engram.js +142 -6
- package/dist/providers/engram.js.map +1 -1
- package/dist/providers/graphify.d.ts +28 -1
- package/dist/providers/graphify.js +114 -16
- package/dist/providers/graphify.js.map +1 -1
- package/dist/providers/graphifyModel.d.ts +23 -0
- package/dist/providers/graphifyModel.js +101 -0
- package/dist/providers/graphifyModel.js.map +1 -0
- package/dist/providers/memory.d.ts +1 -0
- package/dist/providers/memory.js +2 -0
- package/dist/providers/memory.js.map +1 -0
- package/dist/providers/serenaMcp.d.ts +7 -0
- package/dist/providers/serenaMcp.js +77 -0
- package/dist/providers/serenaMcp.js.map +1 -0
- package/dist/providers/types.d.ts +8 -2
- package/dist/providers/versions.d.ts +10 -0
- package/dist/providers/versions.js +3 -0
- package/dist/providers/versions.js.map +1 -0
- package/dist/telemetry/events.d.ts +1 -0
- package/dist/telemetry/events.js +37 -21
- package/dist/telemetry/events.js.map +1 -1
- package/dist/telemetry/otlp.d.ts +7 -1
- package/dist/telemetry/otlp.js +20 -41
- package/dist/telemetry/otlp.js.map +1 -1
- package/dist/telemetry/tracing.d.ts +19 -0
- package/dist/telemetry/tracing.js +141 -0
- package/dist/telemetry/tracing.js.map +1 -0
- package/dist/toolchain/config.js +3 -2
- package/dist/toolchain/config.js.map +1 -1
- package/dist/validators/external.js +27 -5
- package/dist/validators/external.js.map +1 -1
- package/dist/validators/graphify.js +5 -73
- package/dist/validators/graphify.js.map +1 -1
- package/dist/validators/opa.d.ts +14 -1
- package/dist/validators/opa.js +6 -2
- package/dist/validators/opa.js.map +1 -1
- package/dist/validators/toolEvidence.d.ts +9 -0
- package/dist/validators/toolEvidence.js +137 -0
- package/dist/validators/toolEvidence.js.map +1 -0
- package/dist/workers/agentPrompt.d.ts +9 -0
- package/dist/workers/agentPrompt.js +121 -9
- package/dist/workers/agentPrompt.js.map +1 -1
- package/docs/ARCHITECTURE.md +6 -1
- package/docs/COMPONENT_MATURITY.md +47 -0
- package/docs/CONTEXT_EFFICIENCY.md +11 -2
- package/docs/MEMORY.md +9 -0
- package/docs/OBSERVABILITY.md +6 -1
- package/docs/OSS_STACK.md +8 -2
- package/docs/SECURITY.md +12 -0
- package/docs/component-maturity.json +34 -0
- package/package.json +7 -1
- package/policies/core/trust-boundary.rego +14 -4
- package/schemas/project.schema.json +1 -1
- package/schemas/validation-report.schema.json +2 -1
- package/scripts/headroom-bridge.py +88 -0
- package/templates/project.yaml +4 -0
- package/templates/provider-versions.json +10 -0
- package/templates/toolchain.yaml +21 -6
package/docs/OSS_STACK.md
CHANGED
|
@@ -11,8 +11,8 @@ Reference components:
|
|
|
11
11
|
| Worker | OpenCode | Routine implementation using the configured workhorse model |
|
|
12
12
|
| Persistent memory | Engram | Advisory historical memory; adapter is replaceable |
|
|
13
13
|
| Code topology | Graphify | Structural graph and future architecture/blast-radius gates |
|
|
14
|
-
| Semantic code retrieval | Serena 1.
|
|
15
|
-
| Context compression | Headroom 0.
|
|
14
|
+
| Semantic code retrieval | Serena 1.6.1 (`serena-agent`) | Configured local OSS symbol lookup, references and targeted repository navigation; not memory authority |
|
|
15
|
+
| Context compression | Headroom 0.28.0 | Configured local OSS selective compression after AEH projection; no hosted Headroom service required |
|
|
16
16
|
| Specification | SDD + Git | Versioned normative intent |
|
|
17
17
|
| Acceptance | Gherkin + Reqnroll | Executable business behavior for .NET consumers |
|
|
18
18
|
| Policy | OPA/Rego | Centralized allow/deny decisions |
|
|
@@ -24,6 +24,12 @@ Reference components:
|
|
|
24
24
|
| Worker isolation | Podman rootless | Ephemeral least-privilege execution |
|
|
25
25
|
| Telemetry | OpenTelemetry | Portable traces/metrics/log semantics |
|
|
26
26
|
| Provenance | Cosign + in-toto | Artifact signing and attestations |
|
|
27
|
+
|
|
28
|
+
Runtime notes: Serena is the semantic repository adapter and Engram is the
|
|
29
|
+
historical memory adapter; neither is interchangeable with the other. Headroom
|
|
30
|
+
is controller-side compression and is intentionally not exposed as a general
|
|
31
|
+
agent MCP surface. All three remain optional/configurable where the project
|
|
32
|
+
profile permits it, with required providers failing closed.
|
|
27
33
|
| Harness quality | Engineering eval corpus | Reproducible comparison of system variants |
|
|
28
34
|
|
|
29
35
|
Do not add a mandatory SaaS or paid-license dependency because it is convenient. Any hosted integration must be optional behind an interface and have a documented local/OSS path. Serena and Headroom are AEH-managed local tools, pinned through the project toolchain; Headroom's agent-wrapping lifecycle is deliberately not used.
|
package/docs/SECURITY.md
CHANGED
|
@@ -19,3 +19,15 @@ Recommended OSS tools:
|
|
|
19
19
|
- Trivy for vulnerabilities, secrets, IaC and SBOM scanning;
|
|
20
20
|
- OPA for policy-as-code;
|
|
21
21
|
- Cosign/in-toto for later provenance/attestations.
|
|
22
|
+
|
|
23
|
+
External security and browser validators emit normalized findings with stable
|
|
24
|
+
fingerprints (rule, severity, location, package/resource and artifact details)
|
|
25
|
+
while their complete stdout/stderr is retained as a retrievable evidence
|
|
26
|
+
artifact. OPA receives the effective logical agent, role, profile, domains,
|
|
27
|
+
risk, runtime, model alias, permissions, changed files and deterministic
|
|
28
|
+
evidence; it does not receive a fabricated fixed worker identity.
|
|
29
|
+
|
|
30
|
+
Provenance manifests hash the control-plane snapshot, TaskContract/seal,
|
|
31
|
+
OpenSpec source references, operation/report/evidence artifacts, final output
|
|
32
|
+
and SBOM when present. Generated Cosign bundles have an explicit verification
|
|
33
|
+
step; a bundle that cannot be verified is not accepted as provenance.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"levels": ["DECLARED", "ADAPTER", "EXECUTABLE", "WORKFLOW_INTEGRATED", "DOGFOODED", "EVAL_VALIDATED", "PRODUCTION_GRADE"],
|
|
4
|
+
"components": {
|
|
5
|
+
"Paseo": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/paseo", "tests/paseoRuntime.test.ts"] },
|
|
6
|
+
"Codex CLI": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/workers/direct.ts", "tests/runtimeInvocation.test.ts"] },
|
|
7
|
+
"OpenCode": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/agents/permissions.ts", "tests/opencodePaseoCapability.test.ts"] },
|
|
8
|
+
"Engram": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/core/run.ts", "src/memory/candidates.ts", "tests/providerContracts.test.ts", "src/evals/fullStack.ts"] },
|
|
9
|
+
"Graphify": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/providers/graphify.ts", "src/providers/graphifyModel.ts", "tests/providerContracts.test.ts", "src/evals/fullStack.ts"] },
|
|
10
|
+
"OpenSpec": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/spec", "tests/openSpecBridge.test.ts"] },
|
|
11
|
+
"AEH SDD": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/core/sdd.ts", "tests/sdd.test.ts"] },
|
|
12
|
+
"TaskContracts": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/core/seal.ts", "tests/verifyRoots.test.ts"] },
|
|
13
|
+
"Gherkin": { "claimed": "EXECUTABLE", "evidence": ["src/validators/gherkin.ts"] },
|
|
14
|
+
"Reqnroll": { "claimed": "DECLARED", "evidence": ["docs/COMPONENT_MATURITY.md"] },
|
|
15
|
+
".NET/xUnit integration": { "claimed": "EXECUTABLE", "evidence": ["src/validators/commands.ts"] },
|
|
16
|
+
"Testcontainers capability": { "claimed": "DECLARED", "evidence": ["docs/COMPONENT_MATURITY.md"] },
|
|
17
|
+
"Playwright": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/validators/external.ts", "src/validators/toolEvidence.ts", "tests/providerContracts.test.ts", ".github/workflows/ci.yml"] },
|
|
18
|
+
"Pact": { "claimed": "ADAPTER", "evidence": ["src/validators/toolEvidence.ts"] },
|
|
19
|
+
"OPA": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/validators/opa.ts", "tests/architectureIntegrationContracts.test.ts"] },
|
|
20
|
+
"Opengrep": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/validators/external.ts", "src/validators/toolEvidence.ts", "tests/providerContracts.test.ts", ".github/workflows/ci.yml"] },
|
|
21
|
+
"Trivy": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/validators/external.ts", "src/validators/toolEvidence.ts", "tests/providerContracts.test.ts", "src/evals/fullStack.ts", ".github/workflows/ci.yml"] },
|
|
22
|
+
"Podman": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/workers/podman.ts"] },
|
|
23
|
+
"OpenTelemetry": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/telemetry/tracing.ts", "src/telemetry/events.ts"] },
|
|
24
|
+
"Engineering Evals": { "claimed": "DOGFOODED", "evidence": ["src/evals/fullStack.ts"] },
|
|
25
|
+
"SBOM": { "claimed": "EXECUTABLE", "evidence": ["src/provenance/generate.ts"] },
|
|
26
|
+
"Cosign": { "claimed": "EXECUTABLE", "evidence": ["src/provenance/generate.ts"] },
|
|
27
|
+
"in-toto/SLSA": { "claimed": "EXECUTABLE", "evidence": ["src/provenance/generate.ts"] },
|
|
28
|
+
"ContextBudgetGateway": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/context/gateway.ts", "src/workers/agentPrompt.ts"] },
|
|
29
|
+
"Serena": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/context/repository/serena.ts", "src/providers/serenaMcp.ts", "tests/providerContracts.test.ts", "src/context/transport.ts", ".github/workflows/ci.yml"] },
|
|
30
|
+
"Headroom": { "claimed": "EXECUTABLE", "evidence": ["src/context/compression/headroom.ts", "scripts/headroom-bridge.py", "tests/providerContracts.test.ts", "src/evals/fullStack.ts"] },
|
|
31
|
+
"Repository Context Map": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/context/repository/map.ts", "src/workers/agentPrompt.ts"] },
|
|
32
|
+
"aeh_context_retrieve": { "claimed": "WORKFLOW_INTEGRATED", "evidence": ["src/context/retrieval", "src/context/gateway.ts"] }
|
|
33
|
+
}
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-engineering-harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "OSS-first engineering harness for deterministic, spec-driven, issue-driven, audit-governed and orchestration-first multi-agent software delivery.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"schemas",
|
|
16
16
|
"skills",
|
|
17
17
|
"docs",
|
|
18
|
+
"scripts/headroom-bridge.py",
|
|
18
19
|
"scripts/link-self-bin.mjs"
|
|
19
20
|
],
|
|
20
21
|
"scripts": {
|
|
@@ -35,12 +36,17 @@
|
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
38
|
"@opentelemetry/api": "^1.9.0",
|
|
39
|
+
"@opentelemetry/context-async-hooks": "^2.10.0",
|
|
40
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.206.0",
|
|
41
|
+
"@opentelemetry/resources": "^2.10.0",
|
|
42
|
+
"@opentelemetry/sdk-trace-node": "^2.10.0",
|
|
38
43
|
"commander": "^14.0.1",
|
|
39
44
|
"minimatch": "^10.0.3",
|
|
40
45
|
"yaml": "^2.8.1",
|
|
41
46
|
"zod": "^4.0.17"
|
|
42
47
|
},
|
|
43
48
|
"devDependencies": {
|
|
49
|
+
"@playwright/test": "1.62.1",
|
|
44
50
|
"@types/node": "^24.2.1",
|
|
45
51
|
"agentic-engineering-harness": "^0.6.27",
|
|
46
52
|
"tsx": "^4.20.3",
|
|
@@ -3,15 +3,25 @@ package harness.trust_boundary
|
|
|
3
3
|
# Input shape expected from the harness policy adapter:
|
|
4
4
|
# {
|
|
5
5
|
# "changedFiles": [...],
|
|
6
|
-
# "
|
|
7
|
-
# "
|
|
6
|
+
# "frozenChangedFiles": [...],
|
|
7
|
+
# "identity": {"logicalAgent": "...", "role": "...", "permissions": {...}}
|
|
8
8
|
# }
|
|
9
9
|
#
|
|
10
10
|
# Pattern expansion is intentionally performed by the harness before OPA.
|
|
11
11
|
|
|
12
12
|
default allow := true
|
|
13
13
|
|
|
14
|
-
deny contains "implementation
|
|
15
|
-
input.
|
|
14
|
+
deny contains "implementation agent changed a frozen artifact" if {
|
|
15
|
+
input.identity.role == "implementer"
|
|
16
16
|
count(input.frozenChangedFiles) > 0
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
deny contains "read-only role has write permission" if {
|
|
20
|
+
input.identity.role == "reviewer"
|
|
21
|
+
input.identity.permissions.write == "allow"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
deny contains "network permission is forbidden for high-risk execution" if {
|
|
25
|
+
input.identity.risk == "high"
|
|
26
|
+
input.identity.permissions.network == "allow"
|
|
27
|
+
}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
} },
|
|
48
48
|
"delivery": { "type": "object", "properties": { "stateDir": { "type": "string" }, "github": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "tokenEnv": { "type": "string", "minLength": 1 }, "repository": { "type": "string", "pattern": "^[^/]+/[^/]+$" }, "apiBaseUrl": { "type": "string", "format": "uri" }, "assignTokenOwner": { "type": "boolean" }, "labels": { "type": "array", "items": { "type": "string" } }, "branchPattern": { "type": "string", "minLength": 1 }, "finalizeOnAcceptance": { "type": "boolean" }, "pullRequestDraft": { "type": "boolean" } } }, "paseo": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "createWorkspace": { "type": "boolean" }, "autoUseWorkspace": { "type": "boolean" }, "worktreeSlugPattern": { "type": "string", "minLength": 1 } } } } },
|
|
49
49
|
"memory": { "type": "object" },
|
|
50
|
-
"codeIntelligence": { "type": "object", "properties": { "provider": { "type": "string" }, "required": { "type": "boolean" }, "graphPath": { "type": "string" }, "snapshotDir": { "type": "string" }, "refreshCommand": { "type": "string" }, "scheduling": { "type": "object", "properties": { "useEdges": { "type": "boolean" }, "maxGraphHops": { "type": "integer", "minimum": 1 }, "maxSharedNodes": { "type": "integer", "minimum": 0 }, "centralityConflictThreshold": { "type": "number", "minimum": 0 } } } } },
|
|
50
|
+
"codeIntelligence": { "type": "object", "properties": { "provider": { "type": "string" }, "required": { "type": "boolean" }, "graphPath": { "type": "string" }, "snapshotDir": { "type": "string" }, "codeOnly": { "type": "boolean" }, "refreshCommand": { "type": "string" }, "scheduling": { "type": "object", "properties": { "useEdges": { "type": "boolean" }, "maxGraphHops": { "type": "integer", "minimum": 1 }, "maxSharedNodes": { "type": "integer", "minimum": 0 }, "centralityConflictThreshold": { "type": "number", "minimum": 0 } } } } },
|
|
51
51
|
"context": { "type": "object", "properties": {
|
|
52
52
|
"mode": { "enum": ["observe", "enforce"] },
|
|
53
53
|
"budgets": { "type": "object", "properties": {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"taskId": { "type": "string" },
|
|
10
10
|
"status": { "enum": ["PASS", "FAIL"] },
|
|
11
11
|
"checks": { "type": "array" },
|
|
12
|
-
"changedFiles": { "type": "array", "items": { "type": "string" } }
|
|
12
|
+
"changedFiles": { "type": "array", "items": { "type": "string" } },
|
|
13
|
+
"findings": { "type": "array", "items": { "type": "object", "required": ["fingerprint", "tool", "kind"], "properties": { "fingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, "tool": { "type": "string" }, "kind": { "type": "string" }, "rule": { "type": "string" }, "severity": { "type": "string" }, "file": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "message": { "type": "string" }, "artifact": { "type": "string" } }, "additionalProperties": true } }
|
|
13
14
|
},
|
|
14
15
|
"additionalProperties": true
|
|
15
16
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Small, line-oriented JSON bridge for the pinned Headroom SDK.
|
|
3
|
+
|
|
4
|
+
The bridge deliberately uses Headroom's public ``headroom.compression`` API,
|
|
5
|
+
never its agent wrappers or memory store. stdout is reserved for one JSON
|
|
6
|
+
response; diagnostics belong on stderr so the Node adapter can reject framing
|
|
7
|
+
corruption deterministically.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import hashlib
|
|
13
|
+
import json
|
|
14
|
+
import sys
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def fail(message: str, code: str = "HEADROOM_BRIDGE_ERROR") -> None:
|
|
19
|
+
print(json.dumps({"version": 1, "error": {"code": code, "message": message}}), flush=True)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def main() -> int:
|
|
23
|
+
try:
|
|
24
|
+
raw = sys.stdin.read()
|
|
25
|
+
request = json.loads(raw)
|
|
26
|
+
if not isinstance(request, dict) or request.get("version") != 1:
|
|
27
|
+
fail("request version must be 1", "INVALID_REQUEST")
|
|
28
|
+
return 2
|
|
29
|
+
operation = request.get("operation", "compress")
|
|
30
|
+
from headroom import __version__
|
|
31
|
+
|
|
32
|
+
if operation == "doctor":
|
|
33
|
+
print(json.dumps({"version": 1, "providerVersion": __version__}), flush=True)
|
|
34
|
+
return 0
|
|
35
|
+
if operation != "compress":
|
|
36
|
+
fail(f"unsupported operation: {operation}", "INVALID_REQUEST")
|
|
37
|
+
return 2
|
|
38
|
+
|
|
39
|
+
content = request.get("content")
|
|
40
|
+
source_sha256 = request.get("sourceSha256")
|
|
41
|
+
max_tokens = request.get("maxTokens")
|
|
42
|
+
if not isinstance(content, str) or not content:
|
|
43
|
+
fail("content must be a non-empty string", "INVALID_REQUEST")
|
|
44
|
+
return 2
|
|
45
|
+
if not isinstance(source_sha256, str) or hashlib.sha256(content.encode()).hexdigest() != source_sha256:
|
|
46
|
+
fail("sourceSha256 does not match content", "SOURCE_HASH_MISMATCH")
|
|
47
|
+
return 2
|
|
48
|
+
if not isinstance(max_tokens, int) or max_tokens < 1:
|
|
49
|
+
fail("maxTokens must be a positive integer", "INVALID_REQUEST")
|
|
50
|
+
return 2
|
|
51
|
+
|
|
52
|
+
# UniversalCompressor is the documented local SDK entry point. Keep
|
|
53
|
+
# Kompress enabled: AEH provisions headroom-ai[all] and this contract
|
|
54
|
+
# must exercise the intended compression stack, not the fallback-only
|
|
55
|
+
# path. CCR remains disabled because AEH persists and authorizes the
|
|
56
|
+
# original fragment itself.
|
|
57
|
+
from headroom.compression import UniversalCompressor, UniversalCompressorConfig
|
|
58
|
+
|
|
59
|
+
original_tokens = max(1, len(content) // 4)
|
|
60
|
+
target_ratio = min(1.0, max_tokens / original_tokens)
|
|
61
|
+
compressor = UniversalCompressor(
|
|
62
|
+
UniversalCompressorConfig(
|
|
63
|
+
use_magika=True,
|
|
64
|
+
use_kompress=True,
|
|
65
|
+
ccr_enabled=False,
|
|
66
|
+
compression_ratio_target=target_ratio,
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
result = compressor.compress(content)
|
|
70
|
+
response: dict[str, Any] = {
|
|
71
|
+
"version": 1,
|
|
72
|
+
"content": result.compressed,
|
|
73
|
+
"originalTokens": result.tokens_before,
|
|
74
|
+
"compressedTokens": result.tokens_after,
|
|
75
|
+
"reversible": False,
|
|
76
|
+
"providerVersion": __version__,
|
|
77
|
+
"sourceSha256": source_sha256,
|
|
78
|
+
}
|
|
79
|
+
print(json.dumps(response, separators=(",", ":")), flush=True)
|
|
80
|
+
return 0
|
|
81
|
+
except Exception as error: # pragma: no cover - exercised by contract tests
|
|
82
|
+
print(f"headroom bridge failure: {error}", file=sys.stderr, flush=True)
|
|
83
|
+
fail(str(error), "SDK_RUNTIME_FAILURE")
|
|
84
|
+
return 1
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if __name__ == "__main__":
|
|
88
|
+
raise SystemExit(main())
|
package/templates/project.yaml
CHANGED
package/templates/toolchain.yaml
CHANGED
|
@@ -106,15 +106,15 @@ tools:
|
|
|
106
106
|
kind: mise
|
|
107
107
|
command: graphify
|
|
108
108
|
source: "pipx:graphifyy"
|
|
109
|
-
version:
|
|
109
|
+
version: "0.9.43"
|
|
110
110
|
dependsOn: [uv]
|
|
111
111
|
activateWhen: [code-intelligence:graphify]
|
|
112
112
|
|
|
113
113
|
serena:
|
|
114
114
|
kind: mise
|
|
115
115
|
command: serena
|
|
116
|
-
source: "pipx:serena"
|
|
117
|
-
version: "1.
|
|
116
|
+
source: "pipx:serena-agent"
|
|
117
|
+
version: "1.6.1"
|
|
118
118
|
required: true
|
|
119
119
|
dependsOn: [uv, python]
|
|
120
120
|
activateWhen: [semantic-retrieval:serena]
|
|
@@ -123,11 +123,19 @@ tools:
|
|
|
123
123
|
kind: mise
|
|
124
124
|
command: headroom
|
|
125
125
|
source: "pipx:headroom-ai[all]"
|
|
126
|
-
version: "0.
|
|
126
|
+
version: "0.28.0"
|
|
127
127
|
required: true
|
|
128
128
|
dependsOn: [uv, python]
|
|
129
129
|
activateWhen: [compression:headroom]
|
|
130
130
|
|
|
131
|
+
engram:
|
|
132
|
+
kind: mise
|
|
133
|
+
command: engram
|
|
134
|
+
source: "npm:@engram-ai-memory/cli"
|
|
135
|
+
version: "0.4.1"
|
|
136
|
+
dependsOn: [pnpm]
|
|
137
|
+
activateWhen: [memory:engram]
|
|
138
|
+
|
|
131
139
|
opa:
|
|
132
140
|
kind: mise
|
|
133
141
|
command: opa
|
|
@@ -141,14 +149,14 @@ tools:
|
|
|
141
149
|
kind: mise
|
|
142
150
|
command: opengrep
|
|
143
151
|
source: "aqua:opengrep/opengrep"
|
|
144
|
-
version:
|
|
152
|
+
version: "1.22.0"
|
|
145
153
|
activateWhen: [security-tool:opengrep, validator:opengrep]
|
|
146
154
|
|
|
147
155
|
trivy:
|
|
148
156
|
kind: mise
|
|
149
157
|
command: trivy
|
|
150
158
|
source: "aqua:aquasecurity/trivy"
|
|
151
|
-
version:
|
|
159
|
+
version: "0.70.0"
|
|
152
160
|
activateWhen: [security-tool:trivy, validator:trivy]
|
|
153
161
|
container:
|
|
154
162
|
image: ghcr.io/aquasecurity/trivy:latest
|
|
@@ -165,6 +173,13 @@ tools:
|
|
|
165
173
|
command: podman
|
|
166
174
|
activateWhen: [orchestration:podman, sandbox:podman]
|
|
167
175
|
|
|
176
|
+
pnpm:
|
|
177
|
+
kind: mise
|
|
178
|
+
command: pnpm
|
|
179
|
+
source: "npm:pnpm"
|
|
180
|
+
version: "10.15.0"
|
|
181
|
+
activateWhen: [memory:engram, project:pnpm]
|
|
182
|
+
|
|
168
183
|
projectDependencies:
|
|
169
184
|
autoDetect: true
|
|
170
185
|
commands: []
|