software-defence-factory 0.18.2 → 0.18.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.
- package/.agents/skills/factory-foundation/SKILL.md +3 -1
- package/bin/software-defence-factory.mjs +7 -0
- package/docs/architecture.md +5 -1
- package/docs/interfaces.md +6 -1
- package/docs/migration.md +1 -2
- package/docs/npm.md +89 -2
- package/docs/recovery.md +30 -0
- package/docs/setup.md +27 -0
- package/factory/release-check.mjs +34 -0
- package/package.json +1 -1
- package/todo.md +21 -15
|
@@ -44,7 +44,9 @@ the existing issue/task record, not a second project registry.
|
|
|
44
44
|
manager and authenticated SSH forwarding for remote access. Record boot/login
|
|
45
45
|
prerequisites and test restart recovery without starting another native turn.
|
|
46
46
|
Updating or stopping an active or unknown writer must not silently interrupt
|
|
47
|
-
it. Native history and local references remain outside the package.
|
|
47
|
+
it. Native history and local references remain outside the package. Offer the
|
|
48
|
+
[optional OS release check](../../../docs/npm.md#optional-linux-release-check-timer)
|
|
49
|
+
only when selected; a metadata lookup does not install or activate a release.
|
|
48
50
|
- **Proof:** start one bounded issue through the installed Inbox or CLI; inspect
|
|
49
51
|
its native result, explicitly continue it, then run the project's checks and
|
|
50
52
|
independent review against the exact candidate. Qualify only the authorized
|
|
@@ -13,6 +13,7 @@ import { connectBridge, registerBridge } from '../factory/native/bridge-client.m
|
|
|
13
13
|
import { acquireProcessLock } from '../factory/native/process-lock.mjs';
|
|
14
14
|
import { manageNativeService } from '../factory/native/service.mjs';
|
|
15
15
|
import { issueProvider } from '../factory/issue-provider.mjs';
|
|
16
|
+
import { checkRelease } from '../factory/release-check.mjs';
|
|
16
17
|
|
|
17
18
|
const root=fileURLToPath(new URL('../',import.meta.url));
|
|
18
19
|
const version=JSON.parse(readFileSync(join(root,'package.json'),'utf8')).version;
|
|
@@ -36,6 +37,7 @@ Usage:
|
|
|
36
37
|
factory continue ID --turn TURN_ID --feedback TEXT [--state PATH]
|
|
37
38
|
factory interrupt ID --turn TURN_ID [--state PATH]
|
|
38
39
|
factory service install|status|start|stop|restart|remove|cancel-maintenance [--state PATH] [--port PORT]
|
|
40
|
+
factory updates check --channel latest|next
|
|
39
41
|
factory kit --output NEW_DIRECTORY
|
|
40
42
|
factory foundation
|
|
41
43
|
factory probe codex
|
|
@@ -185,6 +187,11 @@ async function command(args) {
|
|
|
185
187
|
const {values,flags}=parse(rest,{positionals:1,allowed:['--state']});
|
|
186
188
|
return online(stateFrom(flags),async bridge=>print(await bridge.request(`/api/v1/jobs/${jobID(values[0])}/resume`,{})));
|
|
187
189
|
}
|
|
190
|
+
if(name==='updates') {
|
|
191
|
+
if(rest[0]!=='check')throw new Error('Use updates check --channel latest|next; release activation remains manual.');
|
|
192
|
+
const {flags}=parse(rest.slice(1),{allowed:['--channel']});
|
|
193
|
+
print(await checkRelease({version,channel:flags['--channel']}));return;
|
|
194
|
+
}
|
|
188
195
|
if(name==='runtime') {
|
|
189
196
|
const {flags}=parse(rest,{allowed:['--state']});
|
|
190
197
|
const result={package:'software-defence-factory',version,entrypoint:root,source_checkout:existsSync(join(root,'.git')),native_state:'unknown'};
|
package/docs/architecture.md
CHANGED
|
@@ -13,7 +13,7 @@ The native harness remains the execution engine.
|
|
|
13
13
|
| Small bridge | Authenticate local requests, associate issues with native sessions, refuse ambiguous or duplicate operations |
|
|
14
14
|
| Codex | Agent loop, context, tools, permissions, sessions and execution history |
|
|
15
15
|
| GitHub | Repository issues, templates, PRs, checks and authorized publication |
|
|
16
|
-
| OS service manager | Start the pinned bridge after login/boot
|
|
16
|
+
| OS service manager | Start the pinned bridge after login/boot, supervise its process and optionally schedule metadata-only release checks |
|
|
17
17
|
|
|
18
18
|
## Small integration boundaries
|
|
19
19
|
|
|
@@ -38,6 +38,10 @@ These receipts prevent uncertain writes being replayed; they are not a queue or
|
|
|
38
38
|
copy of native conversation history. There is one writer per project workspace.
|
|
39
39
|
The repository's normal Git tools own commits and branches.
|
|
40
40
|
|
|
41
|
+
Operator release checks read public npm metadata independently of the bridge or
|
|
42
|
+
native harness. An optional OS timer only schedules that read; activation remains
|
|
43
|
+
manual and must preserve native work. See [packages and releases](npm.md).
|
|
44
|
+
|
|
41
45
|
## Deployment
|
|
42
46
|
|
|
43
47
|

|
package/docs/interfaces.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Interfaces and state
|
|
2
2
|
|
|
3
3
|
The Inbox and operational CLI commands use one running loopback bridge. Setup,
|
|
4
|
-
login, diagnostics, method export and OS-service management
|
|
4
|
+
login, diagnostics, method export, release checking and OS-service management
|
|
5
|
+
are operator commands.
|
|
5
6
|
There is no second CLI execution engine.
|
|
6
7
|
|
|
7
8
|
| Intent | CLI |
|
|
@@ -40,6 +41,10 @@ Never generate a fresh ID merely to retry. Inspect `issues submissions` and use
|
|
|
40
41
|
`issues recover` to look for the existing upstream issue; recovery does not repeat
|
|
41
42
|
creation or start an agent.
|
|
42
43
|
|
|
44
|
+
Release checking is an operator read: `factory updates check --channel next`
|
|
45
|
+
compares public npm metadata with the executing CLI package. It does not activate
|
|
46
|
+
the pinned service or invoke the harness. See [packages and releases](npm.md).
|
|
47
|
+
|
|
43
48
|
## State is observable, not invented
|
|
44
49
|
|
|
45
50
|
- **Backlog**: a repository issue without execution; labels describe planning.
|
package/docs/migration.md
CHANGED
|
@@ -39,5 +39,4 @@ history locations, service identity and tested/untested limits. Roll back only
|
|
|
39
39
|
with a verified idle owner and explicit old-state selection; never point the old
|
|
40
40
|
runtime at native state or let both write the same workspace.
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
promise that they appear in a separate personal Codex Desktop environment.
|
|
42
|
+
For native session visibility and context boundaries, see [setup](setup.md#native-codex-session-visibility).
|
package/docs/npm.md
CHANGED
|
@@ -15,6 +15,93 @@ for occasional use. A long-running service pins an installed package and the
|
|
|
15
15
|
chosen Node binary; it must not run from an editable source checkout or depend on
|
|
16
16
|
an npx cache being retained.
|
|
17
17
|
|
|
18
|
+
## Check a selected channel
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
factory updates check --channel next
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Choose `next` or `latest` explicitly. The command reads public npm metadata and
|
|
25
|
+
compares it with **the CLI package executing the check**, not the pinned running
|
|
26
|
+
service. Use `factory service status --state PATH` to inspect that service's
|
|
27
|
+
version separately. A global npm upgrade does not activate a service release.
|
|
28
|
+
|
|
29
|
+
The JSON result distinguishes `newer`, `current` and `older`. An older channel is
|
|
30
|
+
never an upgrade: `latest` remains 0.17 while native 0.18 is on `next`. A different
|
|
31
|
+
0.x minor line requires deliberate migration. A successful lookup exits zero,
|
|
32
|
+
including when a newer release exists; unavailable, oversized or invalid metadata
|
|
33
|
+
exits nonzero and means availability is unknown. Metadata is not package integrity,
|
|
34
|
+
provenance, review or compatibility proof.
|
|
35
|
+
|
|
36
|
+
Checking requires no Factory state, GitHub/Codex login or npm credentials. It does
|
|
37
|
+
not download, install or activate a release, touch native history, or call a model.
|
|
38
|
+
|
|
39
|
+
## Optional Linux release-check timer
|
|
40
|
+
|
|
41
|
+
Use the OS for periodic checking. After selecting an installed release that
|
|
42
|
+
supports the command, create the following **new** files in your user systemd
|
|
43
|
+
directory (`$XDG_CONFIG_HOME/systemd/user`, normally `~/.config/systemd/user`).
|
|
44
|
+
Inspect existing files first; do not overwrite another operator's units.
|
|
45
|
+
|
|
46
|
+
`factory-release-check.service`:
|
|
47
|
+
|
|
48
|
+
```ini
|
|
49
|
+
[Unit]
|
|
50
|
+
Description=Check the selected Factory release channel
|
|
51
|
+
|
|
52
|
+
[Service]
|
|
53
|
+
Type=oneshot
|
|
54
|
+
ExecStart="/absolute/node" "/absolute/installed/package/bin/software-defence-factory.mjs" updates check --channel next
|
|
55
|
+
TimeoutStartSec=30
|
|
56
|
+
UMask=0077
|
|
57
|
+
NoNewPrivileges=true
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Replace both executable paths with the selected Node and installed package paths;
|
|
61
|
+
`factory runtime` reports the package directory as `entrypoint`; append
|
|
62
|
+
`/bin/software-defence-factory.mjs` for the script path and confirm
|
|
63
|
+
`source_checkout` is false. A version-pinned package can be used instead of the
|
|
64
|
+
global installation. Keep the chosen channel explicit. This unit
|
|
65
|
+
only reads metadata; it never invokes `npm install` or `factory service restart`.
|
|
66
|
+
|
|
67
|
+
`factory-release-check.timer`:
|
|
68
|
+
|
|
69
|
+
```ini
|
|
70
|
+
[Unit]
|
|
71
|
+
Description=Daily Factory release check
|
|
72
|
+
|
|
73
|
+
[Timer]
|
|
74
|
+
OnCalendar=daily
|
|
75
|
+
RandomizedDelaySec=15m
|
|
76
|
+
Persistent=true
|
|
77
|
+
|
|
78
|
+
[Install]
|
|
79
|
+
WantedBy=timers.target
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Validate both files, run one actual lookup, inspect its result, then opt in:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
systemd-analyze --user verify /absolute/path/factory-release-check.service /absolute/path/factory-release-check.timer
|
|
86
|
+
systemctl --user daemon-reload
|
|
87
|
+
systemctl --user start factory-release-check.service
|
|
88
|
+
journalctl --user -u factory-release-check.service -n 20 --no-pager
|
|
89
|
+
systemctl --user enable --now factory-release-check.timer
|
|
90
|
+
systemctl --user list-timers factory-release-check.timer
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The result and errors remain in the OS journal; this is not a dashboard alert or
|
|
94
|
+
an automatic updater. The user service manager must be running; boot without login
|
|
95
|
+
depends on the host's lingering and disk-unlock policy. `Persistent` catches up a
|
|
96
|
+
missed calendar check, subject to the configured random delay; it does not replay
|
|
97
|
+
agent work. See the [systemd timer reference](https://www.freedesktop.org/software/systemd/man/latest/systemd.timer.html).
|
|
98
|
+
|
|
99
|
+
To opt out, disable and stop `factory-release-check.timer`, then remove only the
|
|
100
|
+
two files you created and run `systemctl --user daemon-reload`. This does not stop
|
|
101
|
+
the separate Factory Inbox service or modify native credentials and history.
|
|
102
|
+
Other OS scheduling recipes require separate qualification. No Factory scheduler
|
|
103
|
+
or background loop is installed by the CLI.
|
|
104
|
+
|
|
18
105
|
## Update deliberately
|
|
19
106
|
|
|
20
107
|
0.18 uses `next` so old auto-updaters following `latest` do not silently activate a
|
|
@@ -27,8 +114,8 @@ then perform the supported service replacement and verify readiness/history/UI.
|
|
|
27
114
|
Keep access/profile changes explicit. An npm upgrade alone does not change a
|
|
28
115
|
pinned running service. See [migration](migration.md) and [recovery](recovery.md).
|
|
29
116
|
|
|
30
|
-
|
|
31
|
-
|
|
117
|
+
The optional timer above checks only. Unattended activation remains deferred
|
|
118
|
+
until safe maintenance and rollback are qualified.
|
|
32
119
|
Do not describe a manual update procedure as an automatic updater.
|
|
33
120
|
|
|
34
121
|
## Repository delivery
|
package/docs/recovery.md
CHANGED
|
@@ -18,6 +18,36 @@ bridge. Native Codex owns the full history. Another app-server may read persiste
|
|
|
18
18
|
history without knowing a different process's live state; that read alone cannot
|
|
19
19
|
authorize a competing writer or stopping the original process.
|
|
20
20
|
|
|
21
|
+
## Native Codex login recovery
|
|
22
|
+
|
|
23
|
+
For an expired or revoked login, first inspect work and the selected service:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
factory status --state /absolute/private/factory-state
|
|
27
|
+
factory service status --state /absolute/private/factory-state
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Keep unknown outcomes unknown. Preserve work and reconcile ownership through the
|
|
31
|
+
existing [service operation](#service-operation) rules; do not kill work to
|
|
32
|
+
repair login. Once work is idle and ownership is reconciled, run:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
factory login --state /absolute/private/factory-state
|
|
36
|
+
factory doctor --state /absolute/private/factory-state
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Login is native to the selected Factory Codex home; it does not replace personal
|
|
40
|
+
Codex login. Doctor alone does not prove live inference or token refresh. Do not
|
|
41
|
+
fall back to personal context or duplicate work if authentication remains
|
|
42
|
+
unavailable. For session visibility and account boundaries, see [setup](setup.md#native-codex-session-visibility).
|
|
43
|
+
|
|
44
|
+
A usage-limit response is different from an expired login. A valid account and a
|
|
45
|
+
passing doctor do not establish remaining inference capacity. Preserve the
|
|
46
|
+
current result and wait until native capacity is available; logging in again
|
|
47
|
+
is not a remedy for exhausted usage. Continue a reconciled terminal thread
|
|
48
|
+
explicitly when appropriate, rather than creating a replacement job or switching
|
|
49
|
+
accounts/providers automatically.
|
|
50
|
+
|
|
21
51
|
## Service operation
|
|
22
52
|
|
|
23
53
|
```sh
|
package/docs/setup.md
CHANGED
|
@@ -40,6 +40,33 @@ is not a real execution or sandbox proof. Model preferences belong in the native
|
|
|
40
40
|
configuration; access changes require deliberate requalification. Factory refuses
|
|
41
41
|
an unexplained change to its pinned configuration or skill catalog.
|
|
42
42
|
|
|
43
|
+
## Native Codex session visibility
|
|
44
|
+
|
|
45
|
+
Codex stores configuration, authentication and history under `CODEX_HOME`
|
|
46
|
+
([configuration and state locations](https://learn.chatgpt.com/docs/config-file/config-advanced#config-and-state-locations)).
|
|
47
|
+
Factory uses its dedicated Codex home, so the same ChatGPT account does not
|
|
48
|
+
combine local configuration or history. The supported Factory surface is the
|
|
49
|
+
project Inbox and these commands through its owning bridge:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
factory status --state /absolute/private/factory-state
|
|
53
|
+
factory result ID --state /absolute/private/factory-state
|
|
54
|
+
factory continue ID --turn TURN_ID --feedback TEXT --state /absolute/private/factory-state
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
A separate personal Codex Desktop or remote connection must not be expected to
|
|
58
|
+
show Factory sessions. Desktop remote connections start their server in the
|
|
59
|
+
remote user's login shell ([remote connection documentation](https://learn.chatgpt.com/docs/remote-connections#connect-to-an-ssh-host)).
|
|
60
|
+
Do not copy or symlink authentication, session or database files, or enable
|
|
61
|
+
personal connections to expose Factory work. A persisted native read does not
|
|
62
|
+
authorize another writer. Desktop visibility or resume requires qualification
|
|
63
|
+
for that deployment and is not needed for Factory's current surface.
|
|
64
|
+
|
|
65
|
+
Local-home separation is not account or plan separation. API authentication and
|
|
66
|
+
subscription login are distinct; do not infer plan or quota behavior from local
|
|
67
|
+
state or promise automatic token refresh or indefinite coexistence. For expired
|
|
68
|
+
or revoked login, follow [native Codex login recovery](recovery.md#native-codex-login-recovery).
|
|
69
|
+
|
|
43
70
|
## Start and reach the Inbox
|
|
44
71
|
|
|
45
72
|
```sh
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const packageName='software-defence-factory';
|
|
2
|
+
const versionParts=value=>{
|
|
3
|
+
if(typeof value!=='string'||!/^0\.(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})$/.test(value))
|
|
4
|
+
throw new Error('Release metadata has an unsupported Factory version; inspect the migration manually.');
|
|
5
|
+
return value.split('.').map(Number);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// Read public metadata only. npm credentials, lifecycle scripts and native
|
|
9
|
+
// accounts are not needed; neither the installed package nor service is changed.
|
|
10
|
+
export async function checkRelease({version,channel,request=fetch}) {
|
|
11
|
+
if(!['latest','next'].includes(channel))throw new Error('Choose the release channel explicitly: --channel latest or --channel next.');
|
|
12
|
+
const installed=versionParts(version);
|
|
13
|
+
const response=await request(`https://registry.npmjs.org/${packageName}/${channel}`,{
|
|
14
|
+
headers:{Accept:'application/json'},redirect:'error',signal:AbortSignal.timeout(10000),
|
|
15
|
+
});
|
|
16
|
+
if(!response.ok)throw new Error(`Release lookup failed (HTTP ${response.status}); availability is unknown.`);
|
|
17
|
+
let size=0;const chunks=[];
|
|
18
|
+
if(!response.body)throw new Error('Release lookup returned no metadata; availability is unknown.');
|
|
19
|
+
for await (const chunk of response.body) {
|
|
20
|
+
size+=chunk.byteLength;
|
|
21
|
+
if(size>256000)throw new Error('Release metadata exceeds 256 KB; availability is unknown.');
|
|
22
|
+
chunks.push(chunk);
|
|
23
|
+
}
|
|
24
|
+
let candidate;
|
|
25
|
+
try {candidate=JSON.parse(Buffer.concat(chunks).toString('utf8'));}
|
|
26
|
+
catch {throw new Error('Release metadata is not valid JSON; availability is unknown.');}
|
|
27
|
+
if(candidate?.name!==packageName)throw new Error('Release metadata has a different package identity; availability is unknown.');
|
|
28
|
+
const available=versionParts(candidate.version);
|
|
29
|
+
const difference=available.findIndex((part,index)=>part!==installed[index]);
|
|
30
|
+
const relation=difference<0?'current':available[difference]>installed[difference]?'newer':'older';
|
|
31
|
+
return {package:packageName,channel,checked_at:new Date().toISOString(),installed_version:version,
|
|
32
|
+
available_version:candidate.version,relation,update_available:relation==='newer',
|
|
33
|
+
same_version_line:available[1]===installed[1],verification:'public metadata only',activation:'manual'};
|
|
34
|
+
}
|
package/package.json
CHANGED
package/todo.md
CHANGED
|
@@ -4,33 +4,39 @@
|
|
|
4
4
|
this file preserves order, not a second execution queue. Historical releases and
|
|
5
5
|
retired implementation evidence remain in Git and private installation records.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Native product
|
|
8
|
+
|
|
9
|
+
[PR #120](https://github.com/arcitai/software-and-defence-factory/pull/120)
|
|
10
|
+
delivered native simplification, startup, continuation, scoped Codex permissions
|
|
11
|
+
and architecture in 0.18.0. [PR #122](https://github.com/arcitai/software-and-defence-factory/pull/122)
|
|
12
|
+
delivered Inbox qualification in 0.18.2 and closed #37. Remaining work:
|
|
8
13
|
|
|
9
14
|
- [ ] [#113](https://github.com/arcitai/software-and-defence-factory/issues/113):
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
metadata-only release checks and an optional OS timer recipe are the 0.18.3
|
|
16
|
+
checking slice. Automatic download, idle activation/health and rollback remain
|
|
17
|
+
unqualified; a timer does not deliver automatic service updates.
|
|
12
18
|
- [ ] [#114](https://github.com/arcitai/software-and-defence-factory/issues/114):
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- [ ] [#37](https://github.com/arcitai/software-and-defence-factory/issues/37):
|
|
16
|
-
preserve accepted Inbox UX and share operational actions between CLI/API/UI.
|
|
19
|
+
prove sustained native credential refresh/coexistence and qualify any separately
|
|
20
|
+
selected Desktop integration; these are not delivered.
|
|
17
21
|
- [ ] [#70](https://github.com/arcitai/software-and-defence-factory/issues/70):
|
|
18
|
-
|
|
22
|
+
demonstrate a real-use, vision-bounded improvement in the method and an adopting
|
|
23
|
+
project.
|
|
24
|
+
- [ ] [#6](https://github.com/arcitai/software-and-defence-factory/issues/6):
|
|
25
|
+
resume application use only when the owner resumes it.
|
|
19
26
|
|
|
20
|
-
Completion
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
never revive obsolete jobs automatically.
|
|
27
|
+
Completion follows [CONTRIBUTING.md](CONTRIBUTING.md): independent review and
|
|
28
|
+
relevant checks, with installed execution/adoption evidence where required.
|
|
29
|
+
Preserve existing history; never replay obsolete work automatically.
|
|
24
30
|
|
|
25
31
|
## Later, only for a proven gap
|
|
26
32
|
|
|
27
33
|
- Native harness integrations: [Claude Code #115](https://github.com/arcitai/software-and-defence-factory/issues/115),
|
|
28
34
|
[Cursor #116](https://github.com/arcitai/software-and-defence-factory/issues/116),
|
|
29
|
-
[Grok #117](https://github.com/arcitai/software-and-defence-factory/issues/117)
|
|
35
|
+
[Grok #117](https://github.com/arcitai/software-and-defence-factory/issues/117),
|
|
36
|
+
deferred pending a proven need and separate qualification.
|
|
30
37
|
- [#69 Local Build · Cloud Review](https://github.com/arcitai/software-and-defence-factory/issues/69):
|
|
31
38
|
a qualified native recipe, not a new inference engine.
|
|
32
|
-
- [#
|
|
33
|
-
[#7 scoped defence case](https://github.com/arcitai/software-and-defence-factory/issues/7),
|
|
39
|
+
- [#7 scoped defence case](https://github.com/arcitai/software-and-defence-factory/issues/7),
|
|
34
40
|
[#50 defence method](https://github.com/arcitai/software-and-defence-factory/issues/50).
|
|
35
41
|
- [#27 project accents](https://github.com/arcitai/software-and-defence-factory/issues/27),
|
|
36
42
|
[#51 evidence-backed measurements](https://github.com/arcitai/software-and-defence-factory/issues/51).
|