backend-skeleton 1.5.0 → 1.7.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.
Files changed (40) hide show
  1. package/README.md +113 -8
  2. package/bin/bskel.mjs +549 -63
  3. package/contracts/completeness.mjs +12 -1
  4. package/contracts/openapi.mjs +125 -18
  5. package/handles/providers/java-spring/ast-bridge.mjs +85 -1
  6. package/handles/providers/java-spring/ast-helper/src/main/java/com/backendskeleton/asthelper/Main.java +407 -0
  7. package/handles/providers/java-spring/emit.mjs +126 -6
  8. package/handles/providers/java-spring/plan.mjs +220 -74
  9. package/handles/providers/java-spring/source-splice.mjs +477 -0
  10. package/handles/providers/java-spring/templates/AuthorizationPolicyStub.java.tmpl +30 -0
  11. package/handles/providers/java-spring/templates/HandleController.java.tmpl +21 -3
  12. package/handles/providers/java-spring/templates/ResourceResolver.java.tmpl +26 -0
  13. package/handles/providers/java-spring/templates/ResourceResolverPolicyStub.java.tmpl +9 -0
  14. package/handles/providers/java-spring/templates/ResourceResolverStub.java.tmpl +3 -3
  15. package/lib/attest.mjs +59 -1
  16. package/lib/cli.mjs +125 -7
  17. package/lib/decision-log.mjs +58 -0
  18. package/lib/doctor.mjs +23 -0
  19. package/lib/exit-codes.mjs +17 -0
  20. package/lib/gate-definitions.mjs +65 -2
  21. package/lib/gate-export.mjs +250 -0
  22. package/lib/impact-export-graphify.mjs +145 -0
  23. package/lib/impact-graph.mjs +194 -0
  24. package/lib/impact-surface.mjs +158 -0
  25. package/lib/impact.mjs +334 -0
  26. package/lib/patch-kinds.mjs +24 -0
  27. package/lib/repo.mjs +46 -0
  28. package/lib/workflow.mjs +16 -0
  29. package/package.json +1 -1
  30. package/scanners/adapters/_java-spring-analyzer.mjs +6 -0
  31. package/schemas/decision-event.schema.json +46 -0
  32. package/schemas/gate-attestation.schema.json +6 -1
  33. package/schemas/gate-export.schema.json +606 -22
  34. package/schemas/handles-plan.schema.json +32 -0
  35. package/schemas/impact-baseline.schema.json +59 -0
  36. package/schemas/impact-graph.schema.json +53 -0
  37. package/schemas/impact-report.schema.json +86 -0
  38. package/schemas/impact-resolution.schema.json +33 -0
  39. package/schemas/java-source-splice.schema.json +84 -0
  40. package/schemas/patch-transaction.schema.json +87 -2
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:sbf:decision-event:1",
4
+ "title": "backend-skeleton decision event",
5
+ "description": "D-decision-event-log: one line of a .sbf/<feature_id>.decisions.jsonl file, appended by lib/decision-log.mjs's appendDecisionEvent() every time one of the four spec-side decision files (contract-resolution, cross-feature-resolution, impact-resolution, patch-approvals) is written -- mirrors gate-event.schema.json's own shape and resilience contract exactly (append-only JSONL, a corrupt/invalid line is skipped with a warning at read time, never a hard failure). Deliberately NOT a unified record type across the four decision files themselves -- their on-disk shapes stay exactly as they were (different upsert semantics: contract waivers are append-if-absent, impact dispositions are replace-by-key, and forcing either into the other would be the over-unification this design explicitly rejected). `subject` is a discriminated union keyed on `kind`, carrying that decision kind's REAL key object verbatim -- never flattened to a string -- because a generic string key is exactly how the anti-wildcard property every one of the four already enforces (a decision covers ONE exact subject, never a class of future subjects) would eventually erode. This log is machine-local (.sbf/ is gitignored-by-convention) and is NOT tamper-evident on its own; its evidentiary value comes from being rolled up into a SIGNED gate-export attestation (see D-attestation-payload-completeness), exactly as gates.*.history already is.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema", "kind", "action", "at", "reason", "feature_id", "subject"],
9
+ "properties": {
10
+ "schema": { "const": "sbf.decision-event/1" },
11
+ "kind": { "enum": ["contract_waiver", "cross_feature_waiver", "impact_disposition", "patch_approval"] },
12
+ "action": { "enum": ["record", "renew", "withdraw", "acknowledge"] },
13
+ "at": { "type": "string", "format": "date-time" },
14
+ "reason": { "type": "string", "minLength": 1 },
15
+ "feature_id": { "type": "string" },
16
+ "subject": {
17
+ "description": "The exact key object for this decision, shaped per `kind` -- never a flattened string.",
18
+ "oneOf": [
19
+ {
20
+ "type": "object", "additionalProperties": false,
21
+ "required": ["code", "subject"],
22
+ "properties": { "code": { "type": "string" }, "subject": { "type": ["string", "null"] } }
23
+ },
24
+ {
25
+ "type": "object", "additionalProperties": false,
26
+ "required": ["signal", "identifier", "other_feature"],
27
+ "properties": { "signal": { "type": "string" }, "identifier": { "type": "string" }, "other_feature": { "type": "string" } }
28
+ },
29
+ {
30
+ "type": "object", "additionalProperties": false,
31
+ "required": ["change_key", "downstream_feature"],
32
+ "properties": { "change_key": { "type": "string" }, "downstream_feature": { "type": "string" } }
33
+ },
34
+ {
35
+ "type": "object", "additionalProperties": false,
36
+ "required": ["resource", "field"],
37
+ "properties": { "resource": { "type": "string" }, "field": { "type": "string" } }
38
+ }
39
+ ]
40
+ },
41
+ "mode": { "type": ["string", "null"] },
42
+ "expires_at": { "type": ["string", "null"] },
43
+ "tracked_by": { "type": ["string", "null"] },
44
+ "strategy": { "type": ["string", "null"] }
45
+ }
46
+ }
@@ -15,7 +15,12 @@
15
15
  "required": ["algorithm", "value"],
16
16
  "properties": {
17
17
  "algorithm": { "const": "ed25519" },
18
- "value": { "type": "string", "description": "base64-encoded raw Ed25519 signature bytes over canonicalize(report)." }
18
+ "value": { "type": "string", "description": "base64-encoded raw Ed25519 signature bytes over canonicalize(report)." },
19
+ "key_id": {
20
+ "type": "string",
21
+ "pattern": "^ed25519:[0-9a-f]{32}$",
22
+ "description": "D-attestation-payload-completeness (K6): a SELECTION HINT, not a trust claim. It sits OUTSIDE the signed bytes (only `report` is signed) and is therefore attacker-modifiable -- `bskel attest verify` uses it only to produce a better error message when the wrong --pubkey is supplied. Verification depends solely on the signature over canonicalize(report)."
23
+ }
19
24
  }
20
25
  }
21
26
  }