afyx-engineering-kit 0.0.0-stage → 0.1.0-alpha.3

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.
Files changed (208) hide show
  1. package/.afyx-source-revision +1 -0
  2. package/LICENSE +21 -0
  3. package/README.md +377 -2
  4. package/SECURITY.md +74 -0
  5. package/afyx-context/LICENSE +21 -0
  6. package/afyx-context/README.md +155 -0
  7. package/afyx-context/afyx-context.json +30 -0
  8. package/afyx-context/contracts/integration-v1.schema.json +34 -0
  9. package/afyx-context/package-lock.json +53 -0
  10. package/afyx-context/package.json +34 -0
  11. package/afyx-context/scripts/benchmark.mjs +39 -0
  12. package/afyx-context/scripts/build.mjs +15 -0
  13. package/afyx-context/scripts/comparative-benchmark.mjs +342 -0
  14. package/afyx-context/scripts/comparative-worker.mjs +74 -0
  15. package/afyx-context/scripts/graph-integration-e2e.mjs +188 -0
  16. package/afyx-context/scripts/integrated-dogfood.mjs +309 -0
  17. package/afyx-context/src/budget.js +166 -0
  18. package/afyx-context/src/cli.js +110 -0
  19. package/afyx-context/src/coordination.js +343 -0
  20. package/afyx-context/src/engine.js +198 -0
  21. package/afyx-context/src/errors.js +14 -0
  22. package/afyx-context/src/graph-integration-worker.js +70 -0
  23. package/afyx-context/src/graph-integration.js +373 -0
  24. package/afyx-context/src/graph-mcp-bridge.js +103 -0
  25. package/afyx-context/src/index.js +25 -0
  26. package/afyx-context/src/integrations.js +87 -0
  27. package/afyx-context/src/memory.js +255 -0
  28. package/afyx-context/src/storage.js +364 -0
  29. package/afyx-context/test-fixtures/coordination-worker.mjs +52 -0
  30. package/afyx-context/test-fixtures/graph-consumer-repo/addons/sale_extension/__init__.py +1 -0
  31. package/afyx-context/test-fixtures/graph-consumer-repo/addons/sale_extension/__manifest__.py +4 -0
  32. package/afyx-context/test-fixtures/graph-consumer-repo/addons/sale_extension/models/__init__.py +1 -0
  33. package/afyx-context/test-fixtures/graph-consumer-repo/addons/sale_extension/models/sale_order.py +5 -0
  34. package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/__init__.py +1 -0
  35. package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/__manifest__.py +10 -0
  36. package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/models/__init__.py +2 -0
  37. package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/models/sale_order.py +20 -0
  38. package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/models/sale_order_audit.py +11 -0
  39. package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/security/ir.model.access.csv +2 -0
  40. package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/views/sale_order_views.xml +14 -0
  41. package/afyx-forge/LICENSE +55 -0
  42. package/afyx-forge/README.md +126 -0
  43. package/afyx-forge/afyx-forge.json +28 -0
  44. package/afyx-forge/bin/afyx-forge +4 -0
  45. package/afyx-forge/bin/afyx-forge.cmd +3 -0
  46. package/afyx-forge/bin/afyx-forge.js +16 -0
  47. package/afyx-forge/contracts/forge-plan-v1.schema.json +172 -0
  48. package/afyx-forge/package.json +26 -0
  49. package/afyx-forge/src/classifier.js +190 -0
  50. package/afyx-forge/src/cli.js +111 -0
  51. package/afyx-forge/src/doctor.js +105 -0
  52. package/afyx-forge/src/guidance.js +120 -0
  53. package/afyx-forge/src/index.js +273 -0
  54. package/afyx-forge/src/planning.js +107 -0
  55. package/afyx-forge/src/policy.js +109 -0
  56. package/afyx-forge/src/workflow-refiner.js +151 -0
  57. package/afyx-graph/afyx-graph.json +20 -0
  58. package/afyx-graph/engine/LICENSE +21 -0
  59. package/afyx-graph/engine/README.md +104 -0
  60. package/afyx-graph/engine/release/RELEASE-MANIFEST.json +21 -0
  61. package/afyx-graph/engine/release/SHA256SUMS +2 -0
  62. package/afyx-graph/engine/release/afyx-graph-linux-x64.tar.gz +0 -0
  63. package/afyx-graph/engine/release/afyx-graph-win32-x64.zip +0 -0
  64. package/afyx-graph/engine/scripts/distribution-contract.mjs +212 -0
  65. package/afyx-graph/engine/scripts/distribution-product.json +33 -0
  66. package/bin/afyx-engineering-kit.mjs +61 -0
  67. package/install.ps1 +1053 -0
  68. package/install.sh +617 -0
  69. package/package.json +66 -4
  70. package/scripts/afyx-capability-orchestrator.mjs +752 -0
  71. package/scripts/afyx-claude-integration.mjs +547 -0
  72. package/scripts/afyx-context-artifact.mjs +105 -0
  73. package/scripts/afyx-credential-broker.mjs +75 -0
  74. package/scripts/afyx-doctor.ps1 +152 -0
  75. package/scripts/afyx-doctor.sh +146 -0
  76. package/scripts/afyx-forge-artifact.mjs +183 -0
  77. package/scripts/afyx-global-routing-policy.md +12 -0
  78. package/scripts/afyx-global-routing.mjs +168 -0
  79. package/scripts/afyx-graph-artifact.mjs +178 -0
  80. package/scripts/afyx-host-adapters.mjs +543 -0
  81. package/scripts/afyx-host-bridge-lifecycle.mjs +174 -0
  82. package/scripts/afyx-host-bridge.mjs +288 -0
  83. package/scripts/afyx-integration-contracts.mjs +825 -0
  84. package/scripts/afyx-mcp-integration.mjs +528 -0
  85. package/scripts/afyx-modular-integration.mjs +361 -0
  86. package/scripts/afyx-modular-runtime.mjs +451 -0
  87. package/scripts/afyx-native-skill-host.mjs +124 -0
  88. package/scripts/afyx-npm-installer.mjs +486 -0
  89. package/scripts/afyx-project.ps1 +205 -0
  90. package/scripts/afyx-project.sh +207 -0
  91. package/scripts/afyx-provider-backup.mjs +1206 -0
  92. package/scripts/afyx-provider-integration.mjs +724 -0
  93. package/scripts/afyx-provider-inventory.mjs +147 -0
  94. package/scripts/afyx-security-auditor.mjs +224 -0
  95. package/scripts/afyx-skill-engineering.mjs +354 -0
  96. package/scripts/afyx-tool-family-routing.mjs +64 -0
  97. package/scripts/afyx-universal-runtime.mjs +530 -0
  98. package/scripts/alpha_acceptance_preflight.py +240 -0
  99. package/scripts/benchmark-graph-memory.mjs +96 -0
  100. package/scripts/benchmark_capability_orchestrator.mjs +64 -0
  101. package/scripts/build-windows-installer.ps1 +259 -0
  102. package/scripts/build_forge_synthetic_image.py +328 -0
  103. package/scripts/check-reference-staleness.py +71 -0
  104. package/scripts/components.json +254 -0
  105. package/scripts/contracts/afyx-capability-request-v1.schema.json +189 -0
  106. package/scripts/contracts/afyx-capability-result-v1.schema.json +32 -0
  107. package/scripts/dogfood_engineering_comparison.mjs +303 -0
  108. package/scripts/engineering-assurance.json +28 -0
  109. package/scripts/install-afyx-context.ps1 +142 -0
  110. package/scripts/install-afyx-context.sh +126 -0
  111. package/scripts/install-afyx-forge.ps1 +265 -0
  112. package/scripts/install-afyx-forge.sh +273 -0
  113. package/scripts/install-afyx-graph.ps1 +571 -0
  114. package/scripts/install-afyx-graph.sh +438 -0
  115. package/scripts/install-codex-usage-tracker.ps1 +172 -0
  116. package/scripts/lib/AfyxComponents.psm1 +399 -0
  117. package/scripts/lib/AfyxSkillLifecycle.psm1 +289 -0
  118. package/scripts/lib/AfyxTerminal.psm1 +838 -0
  119. package/scripts/lib/afyx-components.sh +256 -0
  120. package/scripts/lib/afyx-skill-lifecycle.sh +271 -0
  121. package/scripts/link-global-dev.ps1 +193 -0
  122. package/scripts/link-global-dev.sh +130 -0
  123. package/scripts/phase8-paired-evidence.mjs +195 -0
  124. package/scripts/phase8-representative-workload.mjs +771 -0
  125. package/scripts/phase8-session-recorder.mjs +157 -0
  126. package/scripts/phase8_event_ledger.py +248 -0
  127. package/scripts/phase8_evidence_discovery.py +189 -0
  128. package/scripts/prepare-g6-package.mjs +349 -0
  129. package/scripts/resolve-git-release-artifacts.mjs +321 -0
  130. package/scripts/stage-npm-release.mjs +94 -0
  131. package/scripts/validate-afyx-graph.py +203 -0
  132. package/scripts/validate-components.py +194 -0
  133. package/scripts/validate-engineering-assurance.py +281 -0
  134. package/scripts/verify-graph-archive.mjs +64 -0
  135. package/skills/afyx-context/SKILL.md +26 -0
  136. package/skills/afyx-engineering-expert/README.md +42 -0
  137. package/skills/afyx-engineering-expert/SKILL.md +70 -0
  138. package/skills/afyx-engineering-expert/assets/result-template.md +15 -0
  139. package/skills/afyx-engineering-expert/references/ai-ml-engineer.md +17 -0
  140. package/skills/afyx-engineering-expert/references/business-analyst.md +17 -0
  141. package/skills/afyx-engineering-expert/references/clean-code-engineer.md +26 -0
  142. package/skills/afyx-engineering-expert/references/code-reviewer.md +24 -0
  143. package/skills/afyx-engineering-expert/references/cybersecurity-devsecops.md +17 -0
  144. package/skills/afyx-engineering-expert/references/data-analyst-bi.md +24 -0
  145. package/skills/afyx-engineering-expert/references/data-engineer.md +24 -0
  146. package/skills/afyx-engineering-expert/references/database-administrator.md +17 -0
  147. package/skills/afyx-engineering-expert/references/debugging-specialist.md +24 -0
  148. package/skills/afyx-engineering-expert/references/embedded-iot-engineer.md +24 -0
  149. package/skills/afyx-engineering-expert/references/erp-technical-specialist.md +17 -0
  150. package/skills/afyx-engineering-expert/references/hardware-diagnostics-auditor.md +24 -0
  151. package/skills/afyx-engineering-expert/references/hardware-electronics-engineer.md +24 -0
  152. package/skills/afyx-engineering-expert/references/integration-engineer.md +24 -0
  153. package/skills/afyx-engineering-expert/references/legacy-modernization-engineer.md +24 -0
  154. package/skills/afyx-engineering-expert/references/llmops-prompt-engineer.md +24 -0
  155. package/skills/afyx-engineering-expert/references/network-engineer.md +24 -0
  156. package/skills/afyx-engineering-expert/references/performance-benchmark-engineer.md +24 -0
  157. package/skills/afyx-engineering-expert/references/platform-engineer.md +24 -0
  158. package/skills/afyx-engineering-expert/references/product-manager.md +17 -0
  159. package/skills/afyx-engineering-expert/references/qa-engineer.md +17 -0
  160. package/skills/afyx-engineering-expert/references/site-reliability-engineer.md +17 -0
  161. package/skills/afyx-engineering-expert/references/software-engineer.md +17 -0
  162. package/skills/afyx-engineering-expert/references/solutions-architect.md +17 -0
  163. package/skills/afyx-engineering-expert/references/specialists-index.md +33 -0
  164. package/skills/afyx-engineering-expert/references/subject-matter-expert.md +17 -0
  165. package/skills/afyx-engineering-expert/references/system-analyst.md +17 -0
  166. package/skills/afyx-engineering-expert/references/technical-project-manager.md +24 -0
  167. package/skills/afyx-engineering-expert/references/technical-writer.md +24 -0
  168. package/skills/afyx-engineering-expert/references/ui-ux-designer.md +17 -0
  169. package/skills/afyx-engineering-expert/workflows/ai-data-erp.md +20 -0
  170. package/skills/afyx-engineering-expert/workflows/debugging.md +10 -0
  171. package/skills/afyx-engineering-expert/workflows/discovery-design.md +11 -0
  172. package/skills/afyx-engineering-expert/workflows/implementation.md +12 -0
  173. package/skills/afyx-engineering-expert/workflows/incident-reliability.md +12 -0
  174. package/skills/afyx-engineering-expert/workflows/review-audit.md +13 -0
  175. package/skills/afyx-forge/SKILL.md +43 -0
  176. package/skills/afyx-forge/references/adaptive-policy.md +19 -0
  177. package/skills/efficient-coding/SKILL.md +33 -0
  178. package/skills/efficient-coding/references/investigation.md +27 -0
  179. package/skills/efficient-coding/references/token-efficiency.md +25 -0
  180. package/skills/efficient-coding/references/tool-routing.md +13 -0
  181. package/skills/odoo-engineering/SKILL.md +33 -0
  182. package/skills/odoo-engineering/references/common.md +9 -0
  183. package/skills/odoo-engineering/references/odoo-10.md +32 -0
  184. package/skills/odoo-engineering/references/odoo-11.md +26 -0
  185. package/skills/odoo-engineering/references/odoo-12.md +31 -0
  186. package/skills/odoo-engineering/references/odoo-13.md +27 -0
  187. package/skills/odoo-engineering/references/odoo-14.md +31 -0
  188. package/skills/odoo-engineering/references/odoo-15.md +34 -0
  189. package/skills/odoo-engineering/references/odoo-16.md +37 -0
  190. package/skills/odoo-engineering/references/odoo-17.md +37 -0
  191. package/skills/odoo-engineering/references/odoo-18.md +48 -0
  192. package/skills/odoo-engineering/references/odoo-19.md +43 -0
  193. package/skills/odoo-engineering/references/odoo-20.md +39 -0
  194. package/skills/odoo-engineering/references/reference-schema.md +16 -0
  195. package/skills/odoo-engineering/references/version-detection.md +13 -0
  196. package/tools/codex-usage/CodexUsage.psm1 +496 -0
  197. package/tools/codex-usage/codex-usage-doctor.ps1 +150 -0
  198. package/tools/codex-usage/codex-usage-pricing.json +25 -0
  199. package/tools/codex-usage/codex-usage-stop.ps1 +167 -0
  200. package/tools/codex-usage/codex-usage-watch.ps1 +250 -0
  201. package/tools/codex-usage/vscode-user-task.json +31 -0
  202. package/tools/windows-setup/SetupBootstrapper.cs +258 -0
  203. package/uninstall.ps1 +189 -0
  204. package/uninstall.sh +167 -0
  205. package/update.ps1 +95 -0
  206. package/update.sh +67 -0
  207. package/verify.ps1 +411 -0
  208. package/verify.sh +265 -0
@@ -0,0 +1,328 @@
1
+ #!/usr/bin/env python3
2
+ """Reproducibly build and validate the public Forge synthetic OCI fixture."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import hashlib
8
+ import json
9
+ import os
10
+ import re
11
+ import shutil
12
+ import struct
13
+ import subprocess
14
+ import tempfile
15
+ from pathlib import Path
16
+ from typing import Sequence
17
+
18
+
19
+ ROOT = Path(__file__).resolve().parents[1]
20
+ SOURCE = ROOT / "evals/forge/synthetic_image/cell_x86_64.S"
21
+ CONTAINERFILE = ROOT / "evals/forge/synthetic_image/Containerfile"
22
+ EXPECTED_STDOUT = b"AFYX_FORGE_SYNTHETIC_STDOUT_V1\n"
23
+ EXPECTED_STDERR = b"AFYX_FORGE_SYNTHETIC_STDERR_V1\n"
24
+ EXPECTED_ARGUMENT_ERROR = b"AFYX_FORGE_SYNTHETIC_ARGUMENT_ERROR_V1\n"
25
+ IMAGE_ID = re.compile(r"^sha256:[0-9a-f]{64}$")
26
+ PINNED_REFERENCE = re.compile(
27
+ r"^[a-z0-9][a-z0-9._:/-]*@sha256:[0-9a-f]{64}$"
28
+ )
29
+ ROOTLESS_DOCKER_ENDPOINT = "unix:///run/user/1000/afyx-forge/docker.sock"
30
+ APPROVED_CONTAINERFILE_INSTRUCTIONS = (
31
+ "FROM scratch",
32
+ 'LABEL org.opencontainers.image.title="Afyx Forge public synthetic cell" '
33
+ 'org.opencontainers.image.version="1" '
34
+ 'org.opencontainers.image.source="https://github.com/a5zero7/'
35
+ 'afyx-engineering-kit"',
36
+ "COPY --chown=65532:65532 --chmod=0555 forge-synthetic-cell "
37
+ "/opt/afyx/bin/forge-synthetic-cell",
38
+ "USER 65532:65532",
39
+ "WORKDIR /workspace",
40
+ 'ENTRYPOINT ["/opt/afyx/bin/forge-synthetic-cell"]',
41
+ 'CMD ["--mode", "public-synthetic"]',
42
+ )
43
+ CONTAINERFILE_PARSER_DIRECTIVE = re.compile(
44
+ r"^#\s*(?:syntax|escape|check)\s*=", re.IGNORECASE
45
+ )
46
+
47
+
48
+ class FixtureBuildError(RuntimeError):
49
+ """The fixture or image could not be built or verified."""
50
+
51
+
52
+ def docker_cli_prefix(
53
+ runtime: Path, endpoint: str = ROOTLESS_DOCKER_ENDPOINT
54
+ ) -> tuple[str, ...]:
55
+ """Return the only approved explicit rootless Docker CLI prefix."""
56
+
57
+ if not runtime.is_absolute() or ".." in runtime.parts:
58
+ raise FixtureBuildError("an absolute container runtime is required")
59
+ if endpoint != ROOTLESS_DOCKER_ENDPOINT:
60
+ raise FixtureBuildError("rootless Docker endpoint is invalid")
61
+ return (str(runtime), "--host", endpoint)
62
+
63
+
64
+ def compiler_argv(compiler: Path, output: Path) -> tuple[str, ...]:
65
+ """Return the fixed Linux x86-64 standalone build command."""
66
+
67
+ if (
68
+ not compiler.is_absolute()
69
+ or not compiler.is_file()
70
+ or not os.access(compiler, os.X_OK)
71
+ ):
72
+ raise FixtureBuildError("an absolute compiler executable is required")
73
+ return (
74
+ str(compiler),
75
+ "-nostdlib",
76
+ "-static",
77
+ "-no-pie",
78
+ "-fno-ident",
79
+ "-fno-asynchronous-unwind-tables",
80
+ "-fno-stack-protector",
81
+ "-Wl,--build-id=none",
82
+ "-Wl,-z,noexecstack",
83
+ "-Wl,-s",
84
+ "-o",
85
+ str(output),
86
+ str(SOURCE),
87
+ )
88
+
89
+
90
+ def verify_elf_x86_64(path: Path) -> str:
91
+ """Verify a static little-endian x86-64 ELF and return its SHA-256."""
92
+
93
+ data = path.read_bytes()
94
+ if len(data) < 64 or data[:6] != b"\x7fELF\x02\x01":
95
+ raise FixtureBuildError("fixture is not a 64-bit little-endian ELF")
96
+ elf_type, machine = struct.unpack_from("<HH", data, 16)
97
+ if elf_type != 2 or machine != 62:
98
+ raise FixtureBuildError("fixture must be an x86-64 executable")
99
+ program_offset = struct.unpack_from("<Q", data, 32)[0]
100
+ entry_size, entry_count = struct.unpack_from("<HH", data, 54)
101
+ if entry_size < 56 or program_offset + entry_size * entry_count > len(data):
102
+ raise FixtureBuildError("fixture program headers are invalid")
103
+ for index in range(entry_count):
104
+ segment_type = struct.unpack_from(
105
+ "<I", data, program_offset + index * entry_size
106
+ )[0]
107
+ if segment_type == 3:
108
+ raise FixtureBuildError("fixture must not contain a dynamic interpreter")
109
+ return hashlib.sha256(data).hexdigest()
110
+
111
+
112
+ def _containerfile_instructions(text: str) -> tuple[str, ...]:
113
+ """Parse only the whitespace, comments, and continuations we approve."""
114
+
115
+ instructions: list[str] = []
116
+ continued: str | None = None
117
+ for raw_line in text.splitlines():
118
+ line = raw_line.strip()
119
+ if not line:
120
+ if continued is not None:
121
+ raise FixtureBuildError(
122
+ "blank lines are forbidden inside a continued instruction"
123
+ )
124
+ continue
125
+ if line.startswith("#"):
126
+ if continued is not None or CONTAINERFILE_PARSER_DIRECTIVE.match(line):
127
+ raise FixtureBuildError("Containerfile comment is unsupported")
128
+ continue
129
+ logical = (
130
+ f"{continued} {line}".strip() if continued is not None else line
131
+ )
132
+ if logical.endswith("\\"):
133
+ continued = logical[:-1].rstrip()
134
+ continue
135
+ instructions.append(logical)
136
+ continued = None
137
+ if continued is not None:
138
+ raise FixtureBuildError("Containerfile has a dangling continuation")
139
+ return tuple(instructions)
140
+
141
+
142
+ def validate_containerfile(text: str) -> None:
143
+ """Require the exact approved one-stage, one-file image recipe."""
144
+
145
+ if _containerfile_instructions(text) != APPROVED_CONTAINERFILE_INSTRUCTIONS:
146
+ raise FixtureBuildError("Containerfile does not match the frozen fixture contract")
147
+
148
+
149
+ def build_fixture(compiler: Path, output: Path) -> str:
150
+ output.parent.mkdir(parents=True, exist_ok=True)
151
+ environment = {
152
+ "HOME": "/nonexistent",
153
+ "LANG": "C",
154
+ "LC_ALL": "C",
155
+ "PATH": "/usr/bin:/bin",
156
+ "SOURCE_DATE_EPOCH": "0",
157
+ }
158
+ completed = subprocess.run(
159
+ compiler_argv(compiler, output),
160
+ stdin=subprocess.DEVNULL,
161
+ stdout=subprocess.PIPE,
162
+ stderr=subprocess.PIPE,
163
+ check=False,
164
+ timeout=30,
165
+ env=environment,
166
+ )
167
+ if completed.returncode != 0:
168
+ raise FixtureBuildError(
169
+ "fixture compilation failed: "
170
+ + completed.stderr.decode("utf-8", errors="replace").strip()
171
+ )
172
+ output.chmod(0o555)
173
+ return verify_elf_x86_64(output)
174
+
175
+
176
+ def verify_fixture_execution(executable: Path) -> None:
177
+ completed = subprocess.run(
178
+ (str(executable), "--mode", "public-synthetic"),
179
+ stdin=subprocess.DEVNULL,
180
+ stdout=subprocess.PIPE,
181
+ stderr=subprocess.PIPE,
182
+ check=False,
183
+ timeout=5,
184
+ env={"HOME": "/nonexistent", "PATH": "/usr/bin:/bin"},
185
+ )
186
+ if (
187
+ completed.returncode != 0
188
+ or completed.stdout != EXPECTED_STDOUT
189
+ or completed.stderr != EXPECTED_STDERR
190
+ ):
191
+ raise FixtureBuildError("fixture execution contract failed")
192
+
193
+
194
+ def _run_checked(argv: Sequence[str], *, environment: dict[str, str]) -> bytes:
195
+ completed = subprocess.run(
196
+ tuple(argv),
197
+ stdin=subprocess.DEVNULL,
198
+ stdout=subprocess.PIPE,
199
+ stderr=subprocess.PIPE,
200
+ check=False,
201
+ timeout=120,
202
+ env=environment,
203
+ )
204
+ if completed.returncode != 0:
205
+ raise FixtureBuildError(
206
+ completed.stderr.decode("utf-8", errors="replace").strip()
207
+ )
208
+ return completed.stdout
209
+
210
+
211
+ def verify_image_metadata(image: object) -> dict[str, object]:
212
+ """Verify inspected image metadata and return only usable identities."""
213
+
214
+ if not isinstance(image, dict) or not isinstance(image.get("Config"), dict):
215
+ raise FixtureBuildError("container image inspection is invalid")
216
+ image_id = image.get("Id")
217
+ config = image["Config"]
218
+ if (
219
+ not isinstance(image_id, str)
220
+ or not IMAGE_ID.fullmatch(image_id)
221
+ or image.get("Architecture") != "amd64"
222
+ or image.get("Os") != "linux"
223
+ or config.get("User") != "65532:65532"
224
+ or config.get("Entrypoint") != ["/opt/afyx/bin/forge-synthetic-cell"]
225
+ or config.get("Cmd") != ["--mode", "public-synthetic"]
226
+ ):
227
+ raise FixtureBuildError("container image metadata violates the contract")
228
+ repo_digests = image.get("RepoDigests") or []
229
+ if not isinstance(repo_digests, list) or any(
230
+ not isinstance(item, str) for item in repo_digests
231
+ ):
232
+ raise FixtureBuildError("container repository digests are invalid")
233
+ pinned = [item for item in repo_digests if PINNED_REFERENCE.fullmatch(item)]
234
+ return {
235
+ "architecture": "linux/amd64",
236
+ "image_id": image_id,
237
+ "launcher_references": pinned,
238
+ }
239
+
240
+
241
+ def build_image(
242
+ runtime: Path,
243
+ executable: Path,
244
+ tag: str,
245
+ *,
246
+ endpoint: str = ROOTLESS_DOCKER_ENDPOINT,
247
+ ) -> dict[str, object]:
248
+ """Build and verify an amd64 image; never fabricate a pinned reference."""
249
+
250
+ if (
251
+ not runtime.is_absolute()
252
+ or not runtime.is_file()
253
+ or not os.access(runtime, os.X_OK)
254
+ ):
255
+ raise FixtureBuildError("an absolute container runtime is required")
256
+ prefix = docker_cli_prefix(runtime, endpoint)
257
+ validate_containerfile(CONTAINERFILE.read_text("utf-8"))
258
+ environment = {
259
+ "HOME": "/nonexistent",
260
+ "LANG": "C",
261
+ "LC_ALL": "C",
262
+ "PATH": "/usr/bin:/bin",
263
+ "SOURCE_DATE_EPOCH": "0",
264
+ }
265
+ with tempfile.TemporaryDirectory(prefix="afyx-forge-image-") as temporary:
266
+ context = Path(temporary)
267
+ shutil.copyfile(CONTAINERFILE, context / "Containerfile")
268
+ shutil.copyfile(executable, context / "forge-synthetic-cell")
269
+ (context / "forge-synthetic-cell").chmod(0o555)
270
+ os.utime(context / "Containerfile", (0, 0))
271
+ os.utime(context / "forge-synthetic-cell", (0, 0))
272
+ _run_checked(
273
+ (
274
+ *prefix,
275
+ "build",
276
+ "--file",
277
+ str(context / "Containerfile"),
278
+ "--platform",
279
+ "linux/amd64",
280
+ "--network",
281
+ "none",
282
+ "--pull=false",
283
+ "--no-cache",
284
+ "--build-arg",
285
+ "SOURCE_DATE_EPOCH=0",
286
+ "--tag",
287
+ tag,
288
+ str(context),
289
+ ),
290
+ environment=environment,
291
+ )
292
+ raw = _run_checked(
293
+ (*prefix, "image", "inspect", tag), environment=environment
294
+ )
295
+ try:
296
+ inspection = json.loads(raw)
297
+ image = inspection[0]
298
+ except (json.JSONDecodeError, IndexError, TypeError) as error:
299
+ raise FixtureBuildError("container image inspection is invalid") from error
300
+ return verify_image_metadata(image)
301
+
302
+
303
+ def main() -> int:
304
+ parser = argparse.ArgumentParser()
305
+ parser.add_argument("--compiler", type=Path, default=Path("/usr/bin/gcc"))
306
+ parser.add_argument("--output", required=True, type=Path)
307
+ parser.add_argument("--runtime", type=Path)
308
+ parser.add_argument("--image-tag", default="afyx/forge-synthetic:t09-e7-local")
309
+ arguments = parser.parse_args()
310
+
311
+ validate_containerfile(CONTAINERFILE.read_text("utf-8"))
312
+ digest = build_fixture(arguments.compiler, arguments.output)
313
+ verify_fixture_execution(arguments.output)
314
+ result: dict[str, object] = {
315
+ "architecture": "linux/amd64",
316
+ "executable_sha256": digest,
317
+ "image": "NOT TESTED",
318
+ }
319
+ if arguments.runtime is not None:
320
+ result["image"] = build_image(
321
+ arguments.runtime, arguments.output, arguments.image_tag
322
+ )
323
+ print(json.dumps(result, sort_keys=True))
324
+ return 0
325
+
326
+
327
+ if __name__ == "__main__":
328
+ raise SystemExit(main())
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env python3
2
+ """Report Odoo reference files whose verification date is over six months old."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import calendar
7
+ import re
8
+ from datetime import date
9
+ from pathlib import Path
10
+
11
+
12
+ LAST_VERIFIED_RE = re.compile(
13
+ r"^Last verified:\s*(\d{4}-\d{2}-\d{2})\s*$", re.MULTILINE
14
+ )
15
+
16
+
17
+ def six_month_cutoff(today: date) -> date:
18
+ month_index = today.month - 1 - 6
19
+ year = today.year + month_index // 12
20
+ month = month_index % 12 + 1
21
+ day = min(today.day, calendar.monthrange(year, month)[1])
22
+ return date(year, month, day)
23
+
24
+
25
+ def check_references() -> None:
26
+ repository_root = Path(__file__).resolve().parents[1]
27
+ references_dir = repository_root / "skills" / "odoo-engineering" / "references"
28
+ cutoff = six_month_cutoff(date.today())
29
+ references = sorted(references_dir.glob("odoo-*.md"))
30
+
31
+ if not references:
32
+ print(f"WARN: no Odoo reference files found under {references_dir}")
33
+ return
34
+
35
+ stale_count = 0
36
+ unknown_count = 0
37
+ for reference in references:
38
+ try:
39
+ content = reference.read_text(encoding="utf-8")
40
+ match = LAST_VERIFIED_RE.search(content)
41
+ if match is None:
42
+ unknown_count += 1
43
+ print(f"WARN: {reference.name} has no parseable Last verified header")
44
+ continue
45
+
46
+ verified = date.fromisoformat(match.group(1))
47
+ if verified < cutoff:
48
+ stale_count += 1
49
+ print(
50
+ f"WARN: {reference.name} was last verified {verified.isoformat()} "
51
+ f"(older than six months; cutoff {cutoff.isoformat()})"
52
+ )
53
+ except (OSError, UnicodeError, ValueError) as error:
54
+ unknown_count += 1
55
+ print(f"WARN: could not inspect {reference.name}: {error}")
56
+
57
+ if stale_count == 0 and unknown_count == 0:
58
+ print(f"No stale Odoo references found (cutoff {cutoff.isoformat()}).")
59
+
60
+
61
+
62
+ def main() -> int:
63
+ try:
64
+ check_references()
65
+ except Exception as error: # This informational check must never become a gate.
66
+ print(f"WARN: reference staleness check could not complete: {error}")
67
+ return 0
68
+
69
+
70
+ if __name__ == "__main__":
71
+ raise SystemExit(main())
@@ -0,0 +1,254 @@
1
+ {
2
+ "schema_version": 1,
3
+ "control_plane_version": 1,
4
+ "provider_adapter_contract": "ProviderAdapter/v1",
5
+ "provider_adapter_operations": "inspect;plan;apply;verify;uninstall",
6
+ "provider_capability_contract": "ProviderCapability/v1",
7
+ "provider_negotiation_contract": "ProviderCapabilityNegotiation/v1",
8
+ "engineering_task_contract": "AfyxEngineeringTask/v1",
9
+ "engineering_result_contract": "AfyxEngineeringResult/v1",
10
+ "modular_integration_contract": "AfyxModularIntegration/v1",
11
+ "universal_interop_contract": "AfyxUniversalInterop/v1",
12
+ "capability_request_contract": "AfyxCapabilityRequest/v1",
13
+ "capability_result_contract": "AfyxCapabilityResult/v1",
14
+ "governing_principle": "Standalone by Design, Integrated by Contract, Activated by Need.",
15
+ "capability_lifecycle_states": "INSTALLED;AVAILABLE;ELIGIBLE;SELECTED;ACTIVATED;EXECUTED;DEGRADED;UNAVAILABLE",
16
+ "default_provider": "codex",
17
+ "supported_presets": "minimal;recommended;full;custom",
18
+ "providers": [
19
+ {
20
+ "provider": "codex",
21
+ "name": "Codex",
22
+ "primary": "true",
23
+ "ownership_class": "USER",
24
+ "capabilities": "skills;mcp;hooks;provider-routing",
25
+ "host_commands": "codex",
26
+ "surfaces": "cli;ide",
27
+ "mcp_scopes": "global",
28
+ "skill_scopes": "global;workspace",
29
+ "configuration_policy": "merge-afyx-owned-entries-only"
30
+ },
31
+ {
32
+ "provider": "antigravity",
33
+ "name": "Antigravity",
34
+ "primary": "false",
35
+ "ownership_class": "USER",
36
+ "capabilities": "skills;mcp",
37
+ "host_commands": "agy;antigravity",
38
+ "surfaces": "cli;ide",
39
+ "mcp_scopes": "global;workspace",
40
+ "skill_scopes": "ide-global;cli-global;workspace",
41
+ "configuration_policy": "merge-afyx-owned-entries-only"
42
+ },
43
+ {
44
+ "provider": "claude",
45
+ "name": "Claude Code",
46
+ "primary": "false",
47
+ "ownership_class": "USER",
48
+ "capabilities": "instructions;skills;mcp;hooks",
49
+ "host_commands": "claude",
50
+ "surfaces": "cli;ide",
51
+ "mcp_scopes": "global;workspace",
52
+ "skill_scopes": "global;workspace",
53
+ "instruction_scopes": "global;workspace",
54
+ "configuration_policy": "merge-afyx-owned-entries-only"
55
+ }
56
+ ],
57
+ "prerequisites": [
58
+ {
59
+ "key": "platform-shell",
60
+ "class": "REQUIRED",
61
+ "reason": "Runs the documented lifecycle entrypoint for the host OS."
62
+ },
63
+ {
64
+ "key": "git",
65
+ "class": "REQUIRED",
66
+ "reason": "Validates and safely fast-forwards the kit source."
67
+ },
68
+ {
69
+ "key": "codex-or-vscode",
70
+ "class": "REQUIRED",
71
+ "reason": "Provides the supported Codex host."
72
+ },
73
+ {
74
+ "key": "node",
75
+ "class": "COMPONENT_REQUIRED",
76
+ "component": "afyx-graph",
77
+ "minimum_version": "22.5.0",
78
+ "reason": "Runs Afyx Graph."
79
+ },
80
+ {
81
+ "key": "node",
82
+ "class": "COMPONENT_REQUIRED",
83
+ "component": "afyx-context",
84
+ "minimum_version": "22.5.0",
85
+ "reason": "Runs Afyx Context Engine."
86
+ },
87
+ {
88
+ "key": "node",
89
+ "class": "COMPONENT_REQUIRED",
90
+ "component": "afyx-forge",
91
+ "minimum_version": "22.5.0",
92
+ "reason": "Runs Afyx Forge Core."
93
+ },
94
+ {
95
+ "key": "npm",
96
+ "class": "BUILD_ONLY",
97
+ "component": "afyx-graph",
98
+ "reason": "Used only when a verified release artifact is unavailable."
99
+ },
100
+ {
101
+ "key": "archive-checksum",
102
+ "class": "COMPONENT_REQUIRED",
103
+ "component": "afyx-graph",
104
+ "reason": "Extracts and verifies the selected Afyx Graph artifact."
105
+ }
106
+ ],
107
+ "components": [
108
+ {
109
+ "id": "efficient-coding",
110
+ "name": "Efficient Coding",
111
+ "display_name": "Afyx Efficient Coding",
112
+ "primary_capability": "focused-coding-discipline",
113
+ "type": "skill",
114
+ "tier": "core",
115
+ "ownership": "afyx",
116
+ "ownership_class": "AFYX",
117
+ "presets": "minimal;recommended;full",
118
+ "platforms": "all",
119
+ "install_root": "skills_root",
120
+ "install_path": "efficient-coding",
121
+ "version_source": "SKILL.md#metadata.version",
122
+ "version_required": "true",
123
+ "required_files": "SKILL.md;references/investigation.md;references/tool-routing.md;references/token-efficiency.md",
124
+ "legacy_version": "1.1.0",
125
+ "legacy_content_digest": "552421fe133fbd408f2b5532202c33e932b71f16184e43993b9c50785929e987",
126
+ "legacy_content_digest_bash": "f67207805a23f80157109f87fa76c8ed3d44a2aa5884672e60de8b7eaaea178f",
127
+ "legacy_distribution_revision": "b0b4d88eb7c42627598de71d6b0bf26317b9a694"
128
+ },
129
+ {
130
+ "id": "odoo-engineering",
131
+ "name": "Odoo Engineering",
132
+ "display_name": "Afyx Odoo Engineering",
133
+ "primary_capability": "odoo-framework-authority",
134
+ "type": "skill",
135
+ "tier": "core",
136
+ "ownership": "afyx",
137
+ "ownership_class": "AFYX",
138
+ "presets": "minimal;recommended;full",
139
+ "platforms": "all",
140
+ "install_root": "skills_root",
141
+ "install_path": "odoo-engineering",
142
+ "version_source": "SKILL.md#metadata.version",
143
+ "version_required": "true",
144
+ "required_files": "SKILL.md;references/common.md;references/version-detection.md;references/reference-schema.md;references/odoo-10.md;references/odoo-11.md;references/odoo-12.md;references/odoo-13.md;references/odoo-14.md;references/odoo-15.md;references/odoo-16.md;references/odoo-17.md;references/odoo-18.md;references/odoo-19.md;references/odoo-20.md",
145
+ "legacy_version": "1.1.0",
146
+ "legacy_content_digest": "546d823d53d3b3f3e6461f59c52d0e47b25205c23a526eb52bf3bce2df4424a6",
147
+ "legacy_content_digest_bash": "6f02332ecdce4e248507ecdcd481ade7183813b6507654f5d949ffe39e700408",
148
+ "legacy_distribution_revision": "b0b4d88eb7c42627598de71d6b0bf26317b9a694"
149
+ },
150
+ {
151
+ "id": "afyx-engineering-expert",
152
+ "name": "Afyx Engineering Expert",
153
+ "display_name": "Afyx Engineering Expert",
154
+ "primary_capability": "cross-disciplinary-expertise",
155
+ "type": "skill",
156
+ "tier": "optional",
157
+ "ownership": "afyx",
158
+ "ownership_class": "AFYX",
159
+ "presets": "recommended;full",
160
+ "platforms": "all",
161
+ "install_root": "skills_root",
162
+ "install_path": "afyx-engineering-expert",
163
+ "version_source": "SKILL.md#metadata.version",
164
+ "version_required": "true",
165
+ "required_files": "README.md;SKILL.md;assets/result-template.md;references/ai-ml-engineer.md;references/business-analyst.md;references/clean-code-engineer.md;references/code-reviewer.md;references/cybersecurity-devsecops.md;references/data-analyst-bi.md;references/data-engineer.md;references/database-administrator.md;references/debugging-specialist.md;references/embedded-iot-engineer.md;references/erp-technical-specialist.md;references/hardware-diagnostics-auditor.md;references/hardware-electronics-engineer.md;references/integration-engineer.md;references/legacy-modernization-engineer.md;references/llmops-prompt-engineer.md;references/network-engineer.md;references/performance-benchmark-engineer.md;references/platform-engineer.md;references/product-manager.md;references/qa-engineer.md;references/site-reliability-engineer.md;references/software-engineer.md;references/solutions-architect.md;references/specialists-index.md;references/subject-matter-expert.md;references/system-analyst.md;references/technical-project-manager.md;references/technical-writer.md;references/ui-ux-designer.md;workflows/ai-data-erp.md;workflows/debugging.md;workflows/discovery-design.md;workflows/implementation.md;workflows/incident-reliability.md;workflows/review-audit.md"
166
+ },
167
+ {
168
+ "id": "afyx-graph",
169
+ "name": "Afyx Graph",
170
+ "display_name": "Afyx Graph",
171
+ "primary_capability": "repository-graph-evidence",
172
+ "type": "runtime",
173
+ "tier": "optional",
174
+ "ownership": "afyx",
175
+ "ownership_class": "AFYX",
176
+ "presets": "full",
177
+ "platforms": "all",
178
+ "install_root": "afyx_graph_root",
179
+ "install_path": "",
180
+ "version_source": "metadata.json#product_version",
181
+ "version_required": "true",
182
+ "required_files": "metadata.json",
183
+ "required_files_windows": "current/bin/afyx-graph.cmd",
184
+ "required_files_unix": "current/bin/afyx-graph",
185
+ "marker_file": "metadata.json",
186
+ "marker_field": "product_name",
187
+ "marker_value": "Afyx Graph"
188
+ },
189
+ {
190
+ "id": "afyx-context",
191
+ "name": "Afyx Context Engine",
192
+ "display_name": "Afyx Context Engine",
193
+ "primary_capability": "bounded-context-optimization",
194
+ "type": "runtime",
195
+ "tier": "optional",
196
+ "ownership": "afyx",
197
+ "ownership_class": "AFYX",
198
+ "presets": "full",
199
+ "platforms": "all",
200
+ "install_root": "afyx_context_root",
201
+ "install_path": "",
202
+ "version_source": "metadata.json#product_version",
203
+ "version_required": "true",
204
+ "required_files": "metadata.json;integrity.sha256;current/identity.json;current/package.json;current/afyx-context.json;current/dist/cli.js;current/dist/index.js;current/contracts/integration-v1.schema.json",
205
+ "required_files_windows": "current/bin/afyx-context.cmd",
206
+ "required_files_unix": "current/bin/afyx-context",
207
+ "marker_file": "metadata.json",
208
+ "marker_field": "product_name",
209
+ "marker_value": "Afyx Context Engine",
210
+ "integrity_manifest_file": "integrity.sha256",
211
+ "identity_file": "current/identity.json"
212
+ },
213
+ {
214
+ "id": "afyx-forge",
215
+ "name": "Afyx Forge Core",
216
+ "display_name": "Afyx Forge Core",
217
+ "primary_capability": "adaptive-engineering-guidance",
218
+ "type": "runtime",
219
+ "tier": "optional",
220
+ "ownership": "afyx",
221
+ "ownership_class": "AFYX",
222
+ "presets": "full",
223
+ "platforms": "all",
224
+ "install_root": "afyx_forge_root",
225
+ "install_path": "",
226
+ "version_source": "metadata.json#product_version",
227
+ "version_required": "true",
228
+ "required_files": "metadata.json;current/package.json;current/LICENSE;current/afyx-forge.json;current/src/index.js;current/bin/afyx-forge.js",
229
+ "required_files_windows": "current/bin/afyx-forge.cmd",
230
+ "required_files_unix": "current/bin/afyx-forge",
231
+ "marker_file": "metadata.json",
232
+ "marker_field": "product_name",
233
+ "marker_value": "Afyx Forge Core"
234
+ },
235
+ {
236
+ "id": "codex-usage-tracking",
237
+ "name": "Usage Tracking",
238
+ "display_name": "Afyx Codex Usage Tracking",
239
+ "primary_capability": "codex-usage-telemetry",
240
+ "type": "toolset",
241
+ "tier": "optional",
242
+ "ownership": "afyx",
243
+ "ownership_class": "AFYX",
244
+ "presets": "full",
245
+ "platforms": "windows",
246
+ "install_root": "codex_tools",
247
+ "install_path": "",
248
+ "version_source": "",
249
+ "version_required": "false",
250
+ "providers": "codex",
251
+ "required_files": "CodexUsage.psm1;codex-usage-stop.ps1;codex-usage-watch.ps1;codex-usage-doctor.ps1;codex-usage-pricing.json"
252
+ }
253
+ ]
254
+ }