@aqaf/cli 0.0.0-stage → 1.1.1
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/LICENSE +21 -0
- package/README.md +62 -2
- package/bin/aqaf.js +12 -0
- package/index.js +51 -0
- package/package.json +51 -4
- package/vendor/aqaf/__init__.py +2 -0
- package/vendor/aqaf/__main__.py +3 -0
- package/vendor/aqaf/adapters.py +583 -0
- package/vendor/aqaf/artifacts.py +28 -0
- package/vendor/aqaf/calibration.py +29 -0
- package/vendor/aqaf/catalogue.py +257 -0
- package/vendor/aqaf/cli.py +721 -0
- package/vendor/aqaf/cursor.py +56 -0
- package/vendor/aqaf/data/book_review_knowledge.json +1574 -0
- package/vendor/aqaf/data/catalog.json +562 -0
- package/vendor/aqaf/data/documentation_checks.json +52 -0
- package/vendor/aqaf/data/packs/automation.json +16 -0
- package/vendor/aqaf/data/packs/mobile.json +13 -0
- package/vendor/aqaf/data/packs/systems.json +17 -0
- package/vendor/aqaf/data/packs/web.json +16 -0
- package/vendor/aqaf/data/profiles/ai_pipeline.json +39 -0
- package/vendor/aqaf/data/profiles/android.json +34 -0
- package/vendor/aqaf/data/profiles/api_backend.json +44 -0
- package/vendor/aqaf/data/profiles/browser_extension.json +29 -0
- package/vendor/aqaf/data/profiles/cli_automation.json +34 -0
- package/vendor/aqaf/data/profiles/desktop_utility.json +39 -0
- package/vendor/aqaf/data/profiles/embedded_iot.json +34 -0
- package/vendor/aqaf/data/profiles/google_apps_script.json +34 -0
- package/vendor/aqaf/data/profiles/mcp_agent_server.json +34 -0
- package/vendor/aqaf/data/profiles/multirepo_system.json +29 -0
- package/vendor/aqaf/data/profiles/npm_library.json +39 -0
- package/vendor/aqaf/data/profiles/rust_app.json +34 -0
- package/vendor/aqaf/data/profiles/saas_or_web_app.json +44 -0
- package/vendor/aqaf/data/profiles/scraper_data_pipeline.json +39 -0
- package/vendor/aqaf/data/profiles/swift_app.json +34 -0
- package/vendor/aqaf/data/profiles/tauri_electron.json +34 -0
- package/vendor/aqaf/data/profiles/unknown_or_general_app.json +25 -0
- package/vendor/aqaf/data/profiles/windows_client_server.json +34 -0
- package/vendor/aqaf/data/profiles/wordpress_plugin.json +39 -0
- package/vendor/aqaf/data/review_checks.json +319 -0
- package/vendor/aqaf/data/source_registry.json +814 -0
- package/vendor/aqaf/discovery.py +580 -0
- package/vendor/aqaf/documentation.py +210 -0
- package/vendor/aqaf/evidence.py +132 -0
- package/vendor/aqaf/facets.py +63 -0
- package/vendor/aqaf/ignore.py +109 -0
- package/vendor/aqaf/knowledge.py +110 -0
- package/vendor/aqaf/markup.py +96 -0
- package/vendor/aqaf/matching.py +22 -0
- package/vendor/aqaf/portfolio.py +145 -0
- package/vendor/aqaf/project_commands.py +132 -0
- package/vendor/aqaf/projects.py +157 -0
- package/vendor/aqaf/registry.py +125 -0
- package/vendor/aqaf/review.py +446 -0
- package/vendor/aqaf/scope.py +401 -0
- package/vendor/aqaf/swift_review.py +99 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AQAF contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @aqaf/cli — published npm distribution
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This package exposes the **same Python AQAF analyzer** to JS/TS projects, not a second independent scoring implementation. Requires **Node 18+ and Python 3.9+**. No `postinstall` scripts, network calls or execution of target project code. Never run the analyzer on an untrusted repository via arbitrary user hooks: AQAF only reads data.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @aqaf/cli@1.1.1
|
|
7
|
+
npx aqaf . --format json
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Programmatic Node API:
|
|
11
|
+
|
|
12
|
+
```js
|
|
13
|
+
const { scan } = require('@aqaf/cli');
|
|
14
|
+
const report = scan(process.cwd(), { pack: 'web', profile: 'npm_library' });
|
|
15
|
+
console.log(report.findings);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
For a Windows terminal with multiple Python installations set `AQAF_PYTHON`. The public package is https://www.npmjs.com/package/@aqaf/cli The 1.1.1 release includes project discovery, scope filtering, optional documentation and book-informed reviews. See the release evidence for channel installation verification. The hosted cross-platform matrix remains pending; do not infer those results from this local check. For a global CLI use `npm install --global @aqaf/cli@1.1.1`. Further publication requires owner approval.
|
|
19
|
+
|
|
20
|
+
## Owner release preparation
|
|
21
|
+
|
|
22
|
+
The candidate declares public access and the npm registry in `publishConfig`.
|
|
23
|
+
This is configuration, not proof of scope ownership or publication. Repository,
|
|
24
|
+
issue tracker and homepage metadata point to the AQAF project.
|
|
25
|
+
|
|
26
|
+
Build with fresh canonical Python files (Python 3.11+ and npm required):
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
python3 support/aqaf-build/scripts/aqaf_release.py --repo . verify
|
|
30
|
+
python3 support/aqaf-build/scripts/aqaf_release.py --repo . build --targets npm --out /tmp/aqaf-npm-candidate
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Run these commands from the owner repository root with a fresh external output
|
|
34
|
+
directory. The helper writes a tarball, checksums and provenance without
|
|
35
|
+
publishing. Test the exact tarball in an isolated consumer before release.
|
|
36
|
+
Owner tasks and approval gates live in `.tasks/001-npm-preparation.md`,
|
|
37
|
+
`.tasks/002-npm-publication.md` and `.tasks/003-chocolatey-release.md`.
|
|
38
|
+
|
|
39
|
+
`make npm-build PYTHON=python3 NPM_OUT=/tmp/aqaf-npm-candidate` additionally runs
|
|
40
|
+
the packaged-consumer validator from `scripts/release/check_npm_candidate.py`.
|
|
41
|
+
To recheck an existing trusted candidate, pass its exact `.tgz` path to that
|
|
42
|
+
script. It never uploads and does not need npm registry credentials. The active
|
|
43
|
+
build-only npm candidate workflow tests Linux/macOS/Windows with Node 18/24 and
|
|
44
|
+
Python 3.9/3.12; configuration alone is not proof those jobs have passed.
|
|
45
|
+
|
|
46
|
+
## Experimental review option (unreleased 1.2.0)
|
|
47
|
+
|
|
48
|
+
Use `scan(repo, {reviewSignals: true})` or CLI `--review-signals` for bounded JS/TS
|
|
49
|
+
review observations. `reviewSignals` must be boolean. The separate `review` result
|
|
50
|
+
is experimental, unreviewed and unscored; normal findings, scores and baseline
|
|
51
|
+
gates are unchanged. Default calls omit it. No target code or credential decoding
|
|
52
|
+
is performed. This source candidate has not been published.
|
|
53
|
+
|
|
54
|
+
Source candidate 1.3.0 respects `.gitignore` by default. Use
|
|
55
|
+
`scan(repo, {respectGitignore: false})` for an explicit opt-out. Candidate scope
|
|
56
|
+
options include `scopePolicy`, `scopeConfig`, `inventoryAll`, `component`,
|
|
57
|
+
`reviewMaxFiles`, `reviewMaxBytes`, `reviewFileBytes`, `reviewOffset`,
|
|
58
|
+
`reviewCursorIn` and `reviewCursorOut`. `reviewSignals` remains opt-in and unscored.
|
|
59
|
+
The archive includes only Python/JSON runtime files; bytecode caches are excluded.
|
|
60
|
+
|
|
61
|
+
The bundled Python runtime also supports `aqaf projects discover ROOT`, the opt-in local `projects` catalogue commands, and `aqaf docs check ROOT`. Use `invoke(['projects', 'discover', root])` from the Node API for additive commands. Discovery and documentation checks never execute target code; catalogue storage uses Python's standard-library SQLite. Experimental probabilities and observations are uncalibrated and unscored.
|
|
62
|
+
|
|
63
|
+
Add `--review-knowledge` to an assessment for the optional book-informed human review agenda. It uses 31 attributed secondary notes and leaves questions unknown until reviewed; it does not change scores or run target checks.
|
package/bin/aqaf.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
const { invoke } = require('../index');
|
|
4
|
+
try {
|
|
5
|
+
const result = invoke(process.argv.slice(2));
|
|
6
|
+
if (result.stdout) process.stdout.write(result.stdout);
|
|
7
|
+
if (result.stderr) process.stderr.write(result.stderr);
|
|
8
|
+
process.exitCode = result.status == null ? 1 : result.status;
|
|
9
|
+
} catch (error) {
|
|
10
|
+
console.error('AQAF:', error.message);
|
|
11
|
+
process.exitCode = 1;
|
|
12
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
const { spawnSync } = require('node:child_process');
|
|
4
|
+
const vendor = path.join(__dirname, 'vendor');
|
|
5
|
+
|
|
6
|
+
function invoke(args, opts = {}) {
|
|
7
|
+
if (!Array.isArray(args) || args.some(v => typeof v !== 'string')) throw new TypeError('args must be an array of strings');
|
|
8
|
+
const pythonCandidates = opts.python ? [opts.python] : process.env.AQAF_PYTHON ? [process.env.AQAF_PYTHON] : (process.platform === 'win32' ? ['py', 'python', 'python3'] : ['python3','python']);
|
|
9
|
+
for (const command of pythonCandidates) {
|
|
10
|
+
const pre = command === 'py' ? ['-3'] : [];
|
|
11
|
+
const env = { ...process.env, ...(opts.env || {}), PYTHONDONTWRITEBYTECODE: '1', PYTHONPATH: [vendor, process.env.PYTHONPATH].filter(Boolean).join(path.delimiter) };
|
|
12
|
+
const result = spawnSync(command, [...pre, '-m', 'aqaf', ...args], {
|
|
13
|
+
cwd: opts.cwd || process.cwd(), env, encoding: 'utf8', maxBuffer: 32 * 1024 * 1024,
|
|
14
|
+
stdio: opts.stdio || 'pipe', windowsHide: true
|
|
15
|
+
});
|
|
16
|
+
if (result.error && result.error.code === 'ENOENT') continue;
|
|
17
|
+
if (result.error) throw result.error;
|
|
18
|
+
return { status: result.status, stdout: result.stdout, stderr: result.stderr };
|
|
19
|
+
}
|
|
20
|
+
throw new Error('AQAF npm distribution requires Python 3.9+ on PATH. Set AQAF_PYTHON to an absolute Python executable.');
|
|
21
|
+
}
|
|
22
|
+
function scan(repo, options = {}) {
|
|
23
|
+
const argv = [repo, '--format', 'json', '--output', '-'];
|
|
24
|
+
if (options.profile) argv.push('--profile', options.profile);
|
|
25
|
+
if (options.pack) argv.push('--pack', options.pack);
|
|
26
|
+
if (options.reviewSignals !== undefined && typeof options.reviewSignals !== 'boolean') throw new TypeError('reviewSignals must be boolean');
|
|
27
|
+
if (options.reviewSignals) argv.push('--review-signals');
|
|
28
|
+
for (const [name, flag] of [['respectGitignore','gitignore'],['inventoryAll','inventory-all']]) {
|
|
29
|
+
if (options[name] !== undefined && typeof options[name] !== 'boolean') throw new TypeError(`${name} must be boolean`);
|
|
30
|
+
if (options[name] === true) argv.push(`--${flag}`);
|
|
31
|
+
if (name === 'respectGitignore' && options[name] === false) argv.push('--no-gitignore');
|
|
32
|
+
}
|
|
33
|
+
for (const [name,flag] of [['scopePolicy','scope-policy'],['scopeConfig','scope-config'],['component','component'],['reviewCursorIn','review-cursor-in'],['reviewCursorOut','review-cursor-out']]) {
|
|
34
|
+
if (options[name] !== undefined) {
|
|
35
|
+
if (typeof options[name] !== 'string') throw new TypeError(`${name} must be a string`);
|
|
36
|
+
argv.push(`--${flag}`, options[name]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
for (const [name,flag] of [['reviewMaxFiles','review-max-files'],['reviewMaxBytes','review-max-bytes'],['reviewFileBytes','review-file-bytes'],['reviewOffset','review-offset']]) {
|
|
40
|
+
if (options[name] !== undefined) {
|
|
41
|
+
if (!Number.isSafeInteger(options[name]) || options[name] < (name === 'reviewOffset' ? 0 : 1)) throw new TypeError(`${name} must be a bounded integer`);
|
|
42
|
+
argv.push(`--${flag}`, String(options[name]));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
for (const capability of (options.capabilities || [])) argv.push('--capability', capability);
|
|
46
|
+
if (options.profileDir) argv.push('--profile-dir', options.profileDir);
|
|
47
|
+
const result = invoke(argv, options);
|
|
48
|
+
if (result.status !== 0) throw new Error(`AQAF scan failed (${result.status}): ${result.stderr}`);
|
|
49
|
+
return JSON.parse(result.stdout);
|
|
50
|
+
}
|
|
51
|
+
module.exports = { invoke, scan };
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aqaf/cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "Local-first architecture assessment, Node.js distribution wrapper around the bundled AQAF Python engine",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./index.js"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"aqaf": "./bin/aqaf.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin/",
|
|
15
|
+
"vendor/**/*.py",
|
|
16
|
+
"vendor/**/*.json",
|
|
17
|
+
"index.js",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"os": [
|
|
26
|
+
"darwin",
|
|
27
|
+
"linux",
|
|
28
|
+
"win32"
|
|
29
|
+
],
|
|
30
|
+
"keywords": [
|
|
31
|
+
"architecture",
|
|
32
|
+
"codex",
|
|
33
|
+
"code-review",
|
|
34
|
+
"analysis",
|
|
35
|
+
"software-quality"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"test": "node --test test/*.test.js"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/focsd/aqaf.git",
|
|
43
|
+
"directory": "distribution/npm"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://aqaf.focsd.com",
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/focsd/aqaf/issues"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public",
|
|
51
|
+
"registry": "https://registry.npmjs.org/"
|
|
52
|
+
}
|
|
53
|
+
}
|