afyx-engineering-kit 0.1.0-alpha.4 → 0.1.0-alpha.7
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/.afyx-source-revision +1 -1
- package/README.md +12 -0
- package/afyx-graph/engine/release/RELEASE-MANIFEST.json +3 -3
- package/afyx-graph/engine/release/SHA256SUMS +2 -2
- package/afyx-graph/engine/release/afyx-graph-linux-x64.tar.gz +0 -0
- package/afyx-graph/engine/release/afyx-graph-win32-x64.zip +0 -0
- package/bin/afyx-engineering-kit.mjs +22 -1
- package/install.ps1 +84 -13
- package/install.sh +91 -4
- package/package.json +2 -1
- package/scripts/afyx-install-backend.mjs +46 -0
- package/scripts/afyx-install-contract.mjs +139 -0
- package/scripts/afyx-midnight-circuit.mjs +328 -0
- package/scripts/afyx-npm-installer.mjs +27 -5
- package/scripts/install-afyx-forge.ps1 +14 -10
- package/scripts/install-afyx-forge.sh +13 -10
- package/scripts/install-afyx-graph.ps1 +75 -29
- package/scripts/lib/AfyxPlatform.ps1 +133 -0
- package/scripts/lib/AfyxPlatform.psm1 +6 -0
- package/scripts/package-release-zip.ps1 +124 -0
- package/scripts/validate-release-zip-graph.mjs +55 -0
- package/verify.ps1 +27 -10
- package/verify.sh +10 -2
- package/afyx-context/test-fixtures/coordination-worker.mjs +0 -52
- package/afyx-context/test-fixtures/graph-consumer-repo/addons/sale_extension/__init__.py +0 -1
- package/afyx-context/test-fixtures/graph-consumer-repo/addons/sale_extension/__manifest__.py +0 -4
- package/afyx-context/test-fixtures/graph-consumer-repo/addons/sale_extension/models/__init__.py +0 -1
- package/afyx-context/test-fixtures/graph-consumer-repo/addons/sale_extension/models/sale_order.py +0 -5
- package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/__init__.py +0 -1
- package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/__manifest__.py +0 -10
- package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/models/__init__.py +0 -2
- package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/models/sale_order.py +0 -20
- package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/models/sale_order_audit.py +0 -11
- package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/security/ir.model.access.csv +0 -2
- package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/views/sale_order_views.xml +0 -14
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import { AfyxContextEngine } from '../src/engine.js';
|
|
3
|
-
import { ContextStore } from '../src/storage.js';
|
|
4
|
-
|
|
5
|
-
const sleeper = new Int32Array(new SharedArrayBuffer(4));
|
|
6
|
-
const [mode, stateDir, ownerId, sessionId, readyPath, gatePath, outputPath, payload = '', id = 'worker', timeout = '5000'] = process.argv.slice(2);
|
|
7
|
-
|
|
8
|
-
function waitForGate() {
|
|
9
|
-
fs.writeFileSync(readyPath, `${process.pid}\n`, { flag: 'wx' });
|
|
10
|
-
const deadline = Date.now() + 15_000;
|
|
11
|
-
while (!fs.existsSync(gatePath)) {
|
|
12
|
-
if (Date.now() >= deadline) throw new Error('coordination fixture gate timed out');
|
|
13
|
-
Atomics.wait(sleeper, 0, 0, 10);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
if (mode === 'hold') {
|
|
19
|
-
const store = new ContextStore({ stateDir, ownerId, sessionId, lockTimeoutMs: Number(timeout) });
|
|
20
|
-
store.withExclusiveAccess(() => {
|
|
21
|
-
waitForGate();
|
|
22
|
-
Atomics.wait(sleeper, 0, 0, 30_000);
|
|
23
|
-
});
|
|
24
|
-
} else if (mode === 'interrupt-write') {
|
|
25
|
-
const engine = new AfyxContextEngine({ stateDir, ownerId, sessionId, lockTimeoutMs: Number(timeout) });
|
|
26
|
-
const renameSync = fs.renameSync;
|
|
27
|
-
fs.renameSync = (source, destination) => {
|
|
28
|
-
if (destination === engine.store.sessionPath) {
|
|
29
|
-
fs.writeFileSync(readyPath, `${process.pid}\n`, { flag: 'wx' });
|
|
30
|
-
Atomics.wait(sleeper, 0, 0, 30_000);
|
|
31
|
-
}
|
|
32
|
-
return renameSync(source, destination);
|
|
33
|
-
};
|
|
34
|
-
engine.reduce({ segments: [{ id, content: payload }] });
|
|
35
|
-
} else if (mode === 'reduce') {
|
|
36
|
-
waitForGate();
|
|
37
|
-
const engine = new AfyxContextEngine({ stateDir, ownerId, sessionId, lockTimeoutMs: Number(timeout) });
|
|
38
|
-
const result = engine.reduce({ segments: [{ id, content: payload }] });
|
|
39
|
-
fs.writeFileSync(outputPath, JSON.stringify({ ok: true, result }), { flag: 'wx' });
|
|
40
|
-
} else {
|
|
41
|
-
throw new Error(`unknown coordination fixture mode: ${mode}`);
|
|
42
|
-
}
|
|
43
|
-
} catch (error) {
|
|
44
|
-
if (outputPath) {
|
|
45
|
-
fs.writeFileSync(outputPath, JSON.stringify({
|
|
46
|
-
ok: false,
|
|
47
|
-
code: error?.code ?? 'INTERNAL',
|
|
48
|
-
message: error?.message ?? String(error),
|
|
49
|
-
}), { flag: 'wx' });
|
|
50
|
-
}
|
|
51
|
-
process.exitCode = 2;
|
|
52
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from . import models
|
package/afyx-context/test-fixtures/graph-consumer-repo/addons/sale_extension/models/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from . import sale_order
|
package/afyx-context/test-fixtures/integrated-dogfood-repo/addons/integrated_sales/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from . import models
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
from odoo import api, fields, models
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class SaleOrder(models.Model):
|
|
5
|
-
_inherit = "sale.order"
|
|
6
|
-
|
|
7
|
-
afyx_review_note = fields.Char(copy=False)
|
|
8
|
-
afyx_total_snapshot = fields.Monetary(compute="_compute_afyx_total_snapshot")
|
|
9
|
-
|
|
10
|
-
@api.depends("order_line.price_subtotal")
|
|
11
|
-
def _compute_afyx_total_snapshot(self):
|
|
12
|
-
for order in self:
|
|
13
|
-
order.afyx_total_snapshot = sum(order.order_line.mapped("price_subtotal"))
|
|
14
|
-
|
|
15
|
-
def afyx_repeated_summary(self):
|
|
16
|
-
return "AFYX integrated sale summary " * 48
|
|
17
|
-
|
|
18
|
-
def SECURITY(self):
|
|
19
|
-
"""SECURITY ACCESS DENIED evidence must remain byte complete."""
|
|
20
|
-
return self.afyx_review_note
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
from odoo import fields, models
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class SaleOrderAudit(models.Model):
|
|
5
|
-
_inherit = "sale.order"
|
|
6
|
-
|
|
7
|
-
afyx_audit_marker = fields.Char(copy=False)
|
|
8
|
-
|
|
9
|
-
def afyx_diagnostic_boundary(self):
|
|
10
|
-
"""ERROR FAILURE TRACEBACK evidence must remain byte complete."""
|
|
11
|
-
return self.afyx_audit_marker
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<odoo>
|
|
3
|
-
<record id="view_order_form_afyx_integrated" model="ir.ui.view">
|
|
4
|
-
<field name="name">sale.order.form.afyx.integrated</field>
|
|
5
|
-
<field name="model">sale.order</field>
|
|
6
|
-
<field name="inherit_id" ref="sale.view_order_form"/>
|
|
7
|
-
<field name="arch" type="xml">
|
|
8
|
-
<xpath expr="//field[@name='partner_id']" position="after">
|
|
9
|
-
<field name="afyx_review_note"/>
|
|
10
|
-
<field name="afyx_total_snapshot" readonly="1"/>
|
|
11
|
-
</xpath>
|
|
12
|
-
</field>
|
|
13
|
-
</record>
|
|
14
|
-
</odoo>
|