@appport/assessment 0.0.0-stage → 0.1.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Changelog: @appport/assessment
2
+
3
+ ## 0.1.0
4
+
5
+ First release. Static assessment of an existing repository: evidence-backed capability candidates, readiness and a recommended exposure candidate. It reads; it executes, builds and writes nothing in the target.
6
+
7
+ - Scanner 1 (the default): Go and Protocol Buffers; writes `appport.application-assessment/1`.
8
+ - Scanner 2 (`assessRepository(path, { scanner: 2 })`, `appworks assess --scanner 2`): also reads HTTP routes registered in JavaScript and TypeScript (Express, Fastify, Koa router, Hono, NestJS) and writes `appport.application-assessment/2`. A route is evidence that an entry point exists and nothing more: it is never recommended and is not yet extractable (`spec/assessment-1.md` §11).
9
+ - Scanner 1's output does not depend on scanner 2: assessments made with it reproduce.
10
+ - Depends only on `@appport/protocol` 1.3.0.
package/README.md CHANGED
@@ -1,3 +1,46 @@
1
- # Temporary Holding Version
1
+ # @appport/assessment
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ AppWorks existing-application assessment. It reads a repository statically and writes an `appport.application-assessment/1` artifact.
4
+ The artifact is an evidence-backed inventory of the business capabilities the application exposes, how they are implemented, what they
5
+ read, write and call, how they are authorized, validated and tested, and which one is the most reasonable first candidate for AppPort
6
+ exposure. Specification: `spec/assessment-1.md` in [rkendel1/appworks](https://github.com/rkendel1/appworks). JSON Schema ships in `schemas/`.
7
+
8
+ The `appworks` command comes with `@appport/extraction`. This package alone installs `appworks-assess`, which takes the same `assess`
9
+ and `verify` commands.
10
+
11
+ ```sh
12
+ appworks assess ./memos --output memos-assessment.json # exit 0 (complete or partial), 1 fatal, 2 usage, 3 --strict and partial
13
+ appworks verify memos-assessment.json --repo ./memos # integrity, honesty, and every observed location against the files
14
+ ```
15
+
16
+ ```ts
17
+ import { assessRepository, verifyAssessment } from "@appport/assessment";
18
+
19
+ const assessment = assessRepository("./memos");
20
+ assessment.recommendation; // { candidate, reasons, ranking, beforeExposure } or null
21
+ verifyAssessment(assessment, { repository: "./memos" });
22
+ ```
23
+
24
+ | Export | Purpose |
25
+ |---|---|
26
+ | `assessRepository` | the assessment; options for limits, thresholds and (for tests) volatile metadata |
27
+ | `verifyAssessment` | structure, evidence classes and references, verified/authority claims, digest; locations with `repository` |
28
+ | `assessmentDigest`, `evidenceId` | the content rules (`digestOf` of `@appport/protocol`) |
29
+ | `proposeCapabilityName`, `messageSchema` | the AppPort proposal rules |
30
+ | types and constants | `ApplicationAssessment`, `Evidence`, `Candidate`, `ProposedCapability`, `ASSESSMENT_FORMAT`, `EVIDENCE_CLASSES`, `READINESS_CLASSES`, … |
31
+
32
+ **Supported:** Protocol Buffers services with `google.api.http`, and Go (handlers, call graph, SQL literals, status codes, goroutines,
33
+ outbound `net/http`, configuration keys, tests). `go.mod` and `package.json` are read as manifests. Other languages are counted and
34
+ reported, and make an assessment partial.
35
+
36
+ **Scanner 2** (`assessRepository(path, { scanner: 2 })`, `appworks assess --scanner 2`, format `appport.application-assessment/2`) also reads the HTTP
37
+ routes a JavaScript or TypeScript application registers (Express, Fastify, Koa router, Hono, NestJS), with the prefixes of the mounts that lead to
38
+ each, the middleware in front of it and, where one exists, its handler's definition. A route is evidence that an entry point exists and nothing
39
+ more: no handler body is read and no shape is assumed, so a route is `investigate` at best, is never recommended, and cannot yet be extracted.
40
+ Scanner 1 is the default and its output is unchanged, so existing digests still reproduce. See `spec/assessment-1.md` §11.
41
+
42
+ **Guarantees:** it never writes to, executes, builds or imports anything in the target; it never follows symbolic links; it uses no network
43
+ and no language model. Every observed fact has a location you can check; every inference names its basis; what it cannot determine is
44
+ recorded as unknown. It never claims verified behavior, grants no authority, registers nothing, and its proposed capability is not a
45
+ contract. Depends only on `@appport/protocol` 1.3.0. Part of the AppPort ecosystem, not of the AppPort protocol. Not implemented:
46
+ extraction, compilation, execution and migration.
@@ -0,0 +1,40 @@
1
+ import { type ApplicationAssessment } from "./artifact.js";
2
+ export interface AssessOptions {
3
+ /**
4
+ * `1` (default): Go and Protocol Buffers, as before, writing `appport.application-assessment/1`.
5
+ * `2`: also reads HTTP routes from JavaScript and TypeScript (`http.ts`), writing `/2`. A different scanner can assess the same tree
6
+ * differently (`docs/compatibility.md`), so it is chosen, never switched on silently.
7
+ */
8
+ scanner?: 1 | 2;
9
+ maxFileBytes?: number;
10
+ excludedDirectories?: readonly string[];
11
+ maxCallDepth?: number;
12
+ maxReachableFunctions?: number;
13
+ smallSurface?: {
14
+ maxHandlerLines: number;
15
+ maxReachableFunctions: number;
16
+ };
17
+ /** Volatile metadata sources, for tests. They do not affect the digest. */
18
+ now?: () => Date;
19
+ id?: () => string;
20
+ }
21
+ export declare const DEFAULTS: {
22
+ readonly maxCallDepth: 12;
23
+ readonly maxReachableFunctions: 400;
24
+ readonly smallSurface: {
25
+ readonly maxHandlerLines: 80;
26
+ readonly maxReachableFunctions: 60;
27
+ };
28
+ };
29
+ /** Scanner 2's limitations: scanner 1's, with the languages entry replaced and the HTTP reader's added. */
30
+ export declare function limitationsFor(scanner: 1 | 2): ReadonlyArray<{
31
+ code: string;
32
+ description: string;
33
+ }>;
34
+ export declare const LIMITATIONS: ReadonlyArray<{
35
+ code: string;
36
+ description: string;
37
+ }>;
38
+ /** Assesses the repository at `path`. Throws `RepositoryError` for a path that is not a readable directory. */
39
+ export declare function assessRepository(path: string, options?: AssessOptions): ApplicationAssessment;
40
+ //# sourceMappingURL=analyze.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":"AAOA,OAAO,EAUL,KAAK,qBAAqB,EAa3B,MAAM,eAAe,CAAC;AAQvB,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,qBAAqB,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1E,2EAA2E;IAC3E,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,QAAQ;aACnB,YAAY,EAAE,EAAE;aAChB,qBAAqB,EAAE,GAAG;aAC1B,YAAY;iBAAI,eAAe,EAAE,EAAE;iBAAE,qBAAqB,EAAE,EAAE;;CACtD,CAAC;AAiBX,2GAA2G;AAC3G,wBAAgB,cAAc,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAQnG;AAED,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAU5E,CAAC;AAuCF,+GAA+G;AAC/G,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,qBAAqB,CAwxBjG"}