generated from coulomb/repo-seed
Complete extension SDK maturity
This commit is contained in:
13
extensions/sdk-fixture/INTENT.md
Normal file
13
extensions/sdk-fixture/INTENT.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# SDK Fixture Extension
|
||||
|
||||
`sdk-fixture` is a dependency-light guide-board extension used to exercise the
|
||||
extension SDK contracts. It is intentionally small and is not a real assessment
|
||||
program.
|
||||
|
||||
The fixture demonstrates:
|
||||
|
||||
- extension-owned target and assessment profile schemas,
|
||||
- a Python runner that writes native output,
|
||||
- a Python normalizer that converts native output into guide-board evidence,
|
||||
- a mapping set for normalized requirement refs,
|
||||
- copyable profiles for SDK acceptance tests.
|
||||
67
extensions/sdk-fixture/extension.json
Normal file
67
extensions/sdk-fixture/extension.json
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"id": "sdk-fixture",
|
||||
"name": "SDK Fixture Extension",
|
||||
"version": "0.1.0",
|
||||
"extension_type": "repository_quality",
|
||||
"lifecycle_status": "incubating",
|
||||
"supported_frameworks": [
|
||||
"guide-board.sdk-fixture.v1"
|
||||
],
|
||||
"authorities": [],
|
||||
"profile_schemas": [
|
||||
"target-profile",
|
||||
"assessment-profile",
|
||||
{
|
||||
"id": "sdk-fixture-target",
|
||||
"profile_kind": "target",
|
||||
"path": "schemas/sdk-fixture-target.schema.json",
|
||||
"subject_type": "sdk-fixture-target",
|
||||
"description": "Requires the target shape used by the SDK fixture runner."
|
||||
},
|
||||
{
|
||||
"id": "sdk-fixture-assessment",
|
||||
"profile_kind": "assessment",
|
||||
"path": "schemas/sdk-fixture-assessment.schema.json",
|
||||
"description": "Requires the runtime policy used by the SDK fixture normalizer test."
|
||||
}
|
||||
],
|
||||
"check_groups": [
|
||||
{
|
||||
"id": "native-output",
|
||||
"name": "Native Output Normalization",
|
||||
"check_type": "repository_quality",
|
||||
"requirement_refs": [
|
||||
"guide-board.sdk-fixture.v1.native-output"
|
||||
],
|
||||
"runner_ref": "native-probe"
|
||||
}
|
||||
],
|
||||
"preflight_runner": null,
|
||||
"runner_entrypoints": [
|
||||
{
|
||||
"id": "native-probe",
|
||||
"kind": "python_module",
|
||||
"module_path": "runners/native_probe.py",
|
||||
"callable": "run",
|
||||
"command": null,
|
||||
"description": "Writes a tiny native result artifact for the SDK fixture normalizer."
|
||||
}
|
||||
],
|
||||
"normalizers": [
|
||||
{
|
||||
"id": "native-probe-normalizer",
|
||||
"kind": "python_module",
|
||||
"module_path": "normalizers/native_probe.py",
|
||||
"callable": "normalize",
|
||||
"runner_ref": "native-probe",
|
||||
"description": "Converts the SDK fixture native result artifact into guide-board evidence."
|
||||
}
|
||||
],
|
||||
"mappings": [
|
||||
"sdk-fixture-map"
|
||||
],
|
||||
"report_fragments": [],
|
||||
"dependencies": [],
|
||||
"restricted_assets": [],
|
||||
"certification_boundary": "SDK fixture only. It does not certify any product, process, or repository."
|
||||
}
|
||||
16
extensions/sdk-fixture/mappings/sdk-fixture-map.json
Normal file
16
extensions/sdk-fixture/mappings/sdk-fixture-map.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"id": "sdk-fixture-map",
|
||||
"extension_id": "sdk-fixture",
|
||||
"framework_refs": [
|
||||
"guide-board.sdk-fixture.v1"
|
||||
],
|
||||
"mappings": [
|
||||
{
|
||||
"requirement_ref": "guide-board.sdk-fixture.v1.native-output",
|
||||
"target_type": "sdk_contract",
|
||||
"target_id": "normalizer-plugin",
|
||||
"label": "Normalizer Plug-in Contract",
|
||||
"description": "The extension runner can emit native output that a normalizer converts into guide-board evidence."
|
||||
}
|
||||
]
|
||||
}
|
||||
28
extensions/sdk-fixture/normalizers/native_probe.py
Normal file
28
extensions/sdk-fixture/normalizers/native_probe.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""SDK fixture normalizer for native runner output."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def normalize(context: dict) -> dict:
|
||||
run_dir = Path(context["run_dir"])
|
||||
runner_result = context["runner_result"]
|
||||
artifact_ref = runner_result["facts"]["native_result_ref"]
|
||||
native_result = json.loads((run_dir / artifact_ref).read_text(encoding="utf-8"))
|
||||
native_status = native_result.get("native_status")
|
||||
result = "pass" if native_status == "ok" else "fail"
|
||||
return {
|
||||
"result": result,
|
||||
"observations": native_result.get("observations", []),
|
||||
"facts": {
|
||||
"native_status": native_status,
|
||||
"native_score": native_result.get("native_score"),
|
||||
"normalized_by": "native-probe-normalizer"
|
||||
},
|
||||
"artifact_refs": [
|
||||
artifact_ref
|
||||
],
|
||||
"requirement_refs": native_result.get("requirement_refs", []),
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"id": "sdk-fixture-assessment",
|
||||
"framework_refs": [
|
||||
"guide-board.sdk-fixture.v1"
|
||||
],
|
||||
"extension_refs": [
|
||||
"sdk-fixture"
|
||||
],
|
||||
"target_profile_ref": "sdk-fixture-target",
|
||||
"selected_check_groups": {
|
||||
"sdk-fixture": [
|
||||
"native-output"
|
||||
]
|
||||
},
|
||||
"expectations_ref": null,
|
||||
"waivers_ref": null,
|
||||
"output_policy": {
|
||||
"report_formats": [
|
||||
"json",
|
||||
"markdown"
|
||||
],
|
||||
"artifact_retention": "raw-logs-plus-summary"
|
||||
},
|
||||
"retention_policy": {
|
||||
"summary_days": 365,
|
||||
"raw_artifact_days": 30
|
||||
},
|
||||
"runtime_policy": {
|
||||
"offline": true,
|
||||
"timeout_seconds": 30,
|
||||
"fixture_mode": "native-result"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"id": "sdk-fixture-target",
|
||||
"subject_type": "sdk-fixture-target",
|
||||
"subject_name": "SDK Fixture Target",
|
||||
"environment": "test",
|
||||
"scope": [
|
||||
"Extension SDK fixture validation"
|
||||
],
|
||||
"endpoints": [],
|
||||
"artifacts": [
|
||||
"extension.json"
|
||||
],
|
||||
"credentials_ref": null,
|
||||
"declared_capabilities": [
|
||||
"guide-board.sdk-fixture.v1.native-output"
|
||||
],
|
||||
"known_gaps": []
|
||||
}
|
||||
36
extensions/sdk-fixture/runners/native_probe.py
Normal file
36
extensions/sdk-fixture/runners/native_probe.py
Normal file
@@ -0,0 +1,36 @@
|
||||
"""SDK fixture runner that writes a native result artifact."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def run(context: dict) -> dict:
|
||||
run_dir = Path(context["run_dir"])
|
||||
artifact_path = run_dir / "artifacts" / "sdk-fixture" / "native-result.json"
|
||||
artifact_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
native_result = {
|
||||
"native_status": "ok",
|
||||
"native_score": 98,
|
||||
"observations": [
|
||||
"SDK fixture native probe completed."
|
||||
],
|
||||
"requirement_refs": [
|
||||
"guide-board.sdk-fixture.v1.native-output"
|
||||
],
|
||||
}
|
||||
artifact_path.write_text(json.dumps(native_result, indent=2, sort_keys=True), encoding="utf-8")
|
||||
artifact_ref = str(artifact_path.relative_to(run_dir))
|
||||
return {
|
||||
"result": "unknown",
|
||||
"observations": [
|
||||
"SDK fixture runner wrote native output for normalization."
|
||||
],
|
||||
"facts": {
|
||||
"native_result_ref": artifact_ref
|
||||
},
|
||||
"artifact_refs": [
|
||||
artifact_ref
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "SDK Fixture Assessment Profile",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"runtime_policy"
|
||||
],
|
||||
"properties": {
|
||||
"runtime_policy": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"fixture_mode"
|
||||
],
|
||||
"properties": {
|
||||
"fixture_mode": { "enum": ["native-result"] }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "SDK Fixture Target Profile",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"subject_type",
|
||||
"artifacts",
|
||||
"declared_capabilities"
|
||||
],
|
||||
"properties": {
|
||||
"subject_type": { "enum": ["sdk-fixture-target"] },
|
||||
"artifacts": { "type": "array", "minItems": 1 },
|
||||
"declared_capabilities": { "type": "array", "minItems": 1 }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user