@filipebraida/adonis-function-points 0.5.0 → 0.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 (39) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/README.md +101 -292
  3. package/build/{calibration-8eV8CEix.js → calibration-DVIf8hcE.js} +42 -3
  4. package/build/commands/main.js +6 -6
  5. package/build/{fp_calibrate-DUbHiifm.js → fp_calibrate-3TxGdS1b.js} +1 -1
  6. package/build/{fp_count-ChtblhZV.js → fp_count-arGLnVlY.js} +1 -1
  7. package/build/{fp_diff-Dt7J4IWu.js → fp_diff-DBBvzq5x.js} +1 -1
  8. package/build/{fp_explain-DZJ--0-S.js → fp_explain-aNFApwiT.js} +1 -1
  9. package/build/{fp_inventory-CPtmuuke.js → fp_inventory-DIjKIC9t.js} +1 -1
  10. package/build/{fp_metrics-et8F1Wvt.js → fp_metrics-BpU61waG.js} +1 -1
  11. package/build/index.d.ts +8 -4
  12. package/build/index.js +4 -4
  13. package/build/{pipeline-CNTBhs6o.js → pipeline-DO2301fV.js} +2131 -389
  14. package/build/{resolvers-PJwo2Z8R.js → resolvers-DaU4uAqT.js} +603 -165
  15. package/build/{runners-DIt1G85i.js → runners-Dm7cWGa-.js} +6 -3
  16. package/build/src/albrecht/counter.d.ts +38 -5
  17. package/build/src/albrecht/data_functions.d.ts +49 -3
  18. package/build/src/albrecht/diff.d.ts +27 -0
  19. package/build/src/albrecht/index.d.ts +1 -0
  20. package/build/src/albrecht/opaque.d.ts +90 -0
  21. package/build/src/albrecht/technical_filter.d.ts +18 -11
  22. package/build/src/albrecht/transactional_functions.d.ts +7 -0
  23. package/build/src/cli.js +2 -2
  24. package/build/src/define_config.d.ts +55 -57
  25. package/build/src/inventory/graph/call_graph.d.ts +44 -0
  26. package/build/src/inventory/graph/deliveries.d.ts +88 -0
  27. package/build/src/inventory/graph/output_fields.d.ts +143 -0
  28. package/build/src/inventory/paths.d.ts +2 -0
  29. package/build/src/inventory/resolvers/index.d.ts +21 -0
  30. package/build/src/inventory/resolvers/index.js +2 -2
  31. package/build/src/inventory/resolvers/job_dispatch.d.ts +20 -0
  32. package/build/src/inventory/resolvers/local_function.d.ts +24 -0
  33. package/build/src/inventory/resolvers/transformer.d.ts +0 -23
  34. package/build/src/inventory/sources/commands.d.ts +14 -0
  35. package/build/src/inventory/sources/jobs.d.ts +27 -0
  36. package/build/src/pipeline.js +1 -1
  37. package/build/src/types.d.ts +49 -1
  38. package/build/stubs/config.stub +29 -16
  39. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,176 @@ release moves the number for unchanged code, the rule set version moves with it
6
6
  otherwise the difference would measure the tool's change rather than the work, and
7
7
  that difference becomes an invoice.
8
8
 
9
+ ## 0.7.0
10
+
11
+ **Rule set `afp@1.6.0`.** Three rules move the number for unchanged code, every one
12
+ frozen in a fixture with a hand-written reference before the code, and every one
13
+ recounted on the three validated applications function by function — four times for
14
+ the first. A 0.6.0 baseline has to be recounted: the totals move −16, +8 and +21 FP,
15
+ and most of that is new elementary processes the count had never seen.
16
+
17
+ ### Counting
18
+
19
+ - **An output's DETs are what the transaction delivers.** The place an output crosses
20
+ the boundary is the delivery — the props of `inertia.render` / `inertia.modal` /
21
+ `view.render`, the payload of `response.json|ok|created|send`, what a command prints
22
+ — and each value delivered is read back to its origin: a followed call's classified
23
+ **return** (a key of it when destructured or picked: `const { data, meta } = …`,
24
+ `meta.pagina`), a store's columns when rows are handed on, a literal's leaves once, a
25
+ scalar as 1, an echoed input as 0 (it counted on entry, §7.3), and a value nobody can
26
+ read as 1, opaque, **reported by transaction**. A store read to authorise and
27
+ delivered by nothing stays an FTR and contributes no DET; a document built from rows
28
+ (`gerarCsv(produtos)`) carries the rows. A variant **replaces** `toObject()`; a
29
+ function of the same file and a function passed to `.map()` by reference are
30
+ followed; an echo stays an echo through `?? null` and `.toISOString()`;
31
+ `paginator.getMeta()` is four values; a literal with computed keys is one repeating
32
+ attribute; a yes/no, a formatted value, a framework service's answer and an Inertia
33
+ lazy prop are one value. Without a delivery point the output falls back to the
34
+ stores read, as before. On the applications: a home page at 1 DET became 10; a
35
+ petitions list at 8 DET became 60 — its nested transformers, which the unresolved
36
+ variant had hidden; every listing page stopped counting its filters twice.
37
+ - **A function of the same file is followed** (`local-function`), and so is
38
+ `rows.map(paraLinha)`. Not only DETs: the stores those helpers read are FTRs now, and
39
+ two `POST`s that wrote through a local helper moved from EO to EI. Models and modules
40
+ imported **inside** a body (`const { default: X } = await import('#…')`) bind like a
41
+ static import — an importer that wrote four tables this way had touched nothing.
42
+ - **An ace command is an elementary process.** `commands/**` extending `BaseCommand`
43
+ with a literal `static commandName` is an entry point (`ace <commandName>`, §5); its
44
+ body is `run()`, its input DETs the `@flags.*` / `@args.*` declared, by the name the
45
+ operator types; what it prints (`this.ui.table().row(…)`, `this.logger.info(…)`) is
46
+ its output, read by the same classifier. One that reaches no store is no transaction.
47
+ Every counted command is **listed with its FP**, a file importing `@faker-js/faker`
48
+ carries the hint "generates data, probably a development tool", and
49
+ `boundary.ignoreEntryPoints: ['<commandName>']` records the decision — the CPM does
50
+ not count the team's tools, and the code cannot tell a generator from an importer.
51
+
52
+ ### New
53
+
54
+ - **A job no transaction reaches is reported, never counted**: "scheduled from
55
+ start/scheduler.ts, outside every transaction", "dispatched from app/…/service.ts,
56
+ which no transaction reaches", or "dispatched by nothing in the application". A
57
+ scheduled process is an elementary process nobody is counting; inventing one is the
58
+ error this package exists to avoid, so it becomes an entry point only once a
59
+ scheduler is read as a source (counting-decisions §9).
60
+ - The `transform` before a `useVariant` is claimed and followed nowhere, instead of
61
+ falling to `static-service` and being reported as a package method with no body —
62
+ which is what every variant chain had been doing to the unresolved count.
63
+
64
+ ### Documented
65
+
66
+ - counting-decisions §6 gains the delivery table and the eleven-row table of how a
67
+ delivered value is read back to its origin; §5 says how a command's identity is
68
+ rendered; §9 gains "A job no transaction reaches is reported, never counted".
69
+ - Two reference fixtures written before their rules: `render_props` (62 FP, thirteen
70
+ shapes of delivery, one added per recount) and `ace_commands` (26 FP; the previous
71
+ rule set said 9 — the table only commands maintain looked like an EIF); a pattern
72
+ fixture `local_function` for the resolver.
73
+ - Reading the page (`.tsx` / `.edge`) for what it shows of a raw prop — plan 0.7 §B —
74
+ is deferred to 0.8, as the plan allowed: the delivery rule made it a refinement of one
75
+ case, and the recounts spent the release on the cases that moved numbers.
76
+
77
+ ## 0.6.0
78
+
79
+ **Rule set `afp@1.5.0`.** Six rules change what a number is made of, all of them found
80
+ by counting real applications function by function against what a certified counter
81
+ would write down — and every one was frozen in a fixture with a hand-written reference
82
+ **before** the code. A 0.5.0 baseline has to be recounted; on the three applications
83
+ this release was reviewed against the totals move −18, −8 and −37 FP, and the whole
84
+ of it is EOs losing DETs they never showed and one data function that was four.
85
+
86
+ ### Counting
87
+
88
+ - **An output's DETs are what leaves the boundary, not every column read.** A
89
+ transformer decides the output of the store it is FOR (`BaseTransformer<X>`, and the
90
+ resources of the transformers nested in it): the keys the reached method returns, a
91
+ nested transformer's keys once, `this.pick([...])` by name, `xs.map(...)` as a
92
+ repeating group. For every other store touched, what leaves is what the code shows:
93
+ rows whole (every column), the columns a `.select()` names, or **one derived scalar**
94
+ for `.count()` / `.exists()`. A relation preloaded through a covered store and read
95
+ no other way is covered too — it was loaded for the transformer. A spread the walker
96
+ cannot read counts 1 DET as a floor and is reported, like an open input object.
97
+ Before, a detail page through three transformers came out at 67 DET; a dashboard of
98
+ eight counters at 84.
99
+ - **A system timestamp is not a DET.** `autoCreate` / `autoUpdate` say the framework
100
+ stamps the column; the user neither supplies nor recognises it — the ground the key
101
+ was already excluded on. Excluded on the data function, on every output, and on a
102
+ transformer that re-emits it. A `dateTime` the user sets still counts. AFP §7.2 on
103
+ its letter would count both; the departure is now consistent, and counting-decisions
104
+ §6 says so.
105
+ - **A column declared `serializeAs: null` never leaves.** Lucid does not serialise it,
106
+ so it is not an output DET however the store leaves. It stays a DET of the data
107
+ function. Found as `User.password` on an activity log's output.
108
+ - **A detail the user only sees inside its master is a RET, not a data function.** A
109
+ `hasMany` / `hasOne` child that no application code addresses directly — only
110
+ `related()` / `preload()` from the parent — folds into the parent: one ILF with N RET,
111
+ the child's link to the parent excluded from the DETs, one FTR for a transaction
112
+ touching both. A child with a query of its own stays its own file (the Vazquez
113
+ benchmark depends on it); a child hanging off two parents stays apart and the report
114
+ says why. Cascade delete was measured and rejected as the signal: on one application
115
+ 11 of 13 cascades pointed at the tenant table. On the three applications the rule
116
+ folds four stores in all — the `Inpi*` mirror of an external registry becomes **one**
117
+ EIF with 4 RET, which is what the CPM says.
118
+ - **A data function is identified by its table**, as counting-decisions §5 always said.
119
+ Keyed by the class, renaming a model billed as a deletion plus an addition.
120
+ - **A token table is technical.** `password_reset_tokens`, `auth_access_tokens`,
121
+ `remember_me_tokens` are the machinery of authentication; `.*tokens?.*` joins the
122
+ naming list. And the list is now configurable in fact — `boundary.technicalPatterns`
123
+ replaces it, `DEFAULT_TECHNICAL_PATTERNS` is exported to start from — as §4 and the
124
+ filter's own comment had claimed since 0.1.0 while `counter.ts` passed nothing.
125
+
126
+ ### Configuration
127
+
128
+ - **`opaque.<Store.column | validator.field>`** replaces `overrides.<fn>.detFromSchema`
129
+ and `overrides.<fn>.opaqueReviewed`. A declaration about a DET the analysis cannot read
130
+ is about the column or the validator field — its ORIGIN — and applies to every
131
+ function that carries it: the ILF, the transaction that submits it, each screen that
132
+ shows it. Read from a real configuration, the old shape had the same mapping written
133
+ twice and a `GET` returning the same column still at 1 DET: the same column worth two
134
+ numbers in one count. Reviews are matched exactly; matched by bare name, reviewing
135
+ `Message.schema` reviewed every `schema` column of every store. A column may be keyed
136
+ by model or by table. The two old keys are gone from the type — an old configuration
137
+ fails to typecheck — and, because a configuration file is loaded without types,
138
+ `fp:count` still tells one that carries them that they had no effect.
139
+ `overrides.<fn>.det` / `.refs` remain per function.
140
+ - **`dataFunctions.grouping: 'usage' | 'none'`** replaces `retStrategy`. `none` is the
141
+ 0.5.0 behaviour — every table its own data function at RET 1 — for comparing with an
142
+ old count; it is not a preference. `retStrategy` is gone from the type, and `fp:count`
143
+ says so when an untyped configuration still carries it.
144
+ - **`boundary.technicalPatterns`**, see above.
145
+
146
+ ### New
147
+
148
+ - **The count names what it cannot decide.** Two transactions of the same type that
149
+ reach the same stores, emit the same DETs and walk the same bodies below the
150
+ controller are reported as look-alikes with the FP at stake — the CPM counts
151
+ identical processing logic once, and `boundary.ignoreEntryPoints` records the
152
+ decision. An EIF only a seeder writes is reported too: code data the team maintains
153
+ is not counted, a mirror of another system's data is a legitimate EIF, and the code
154
+ cannot tell which. Neither moves a number (counting-decisions §11).
155
+ - **`diff.preset: 'sisp'`** prices change by the Roteiro de Métricas de Software do SISP
156
+ v3.0 (Portaria SGD/MGI nº 3656/2026), §7.3 — inclusão 1,00, alteração × FI 0,63 (the
157
+ contractor maintains its own work; 0,84 otherwise, via `factors`), exclusão 0,50 —
158
+ instead of AEP. `fp:diff` prints which preset produced the billable total. Read from
159
+ the guide's PDF: a first draft of this preset said 0,50 / 0,30 from memory, and v2.0
160
+ (2012) priced exclusion at 0,40 — a contract binds to a revision, so check yours.
161
+ - **`ignoreCalls({ name, methods | matching })`** builds a "this reaches no data"
162
+ strategy without the ceremony a real configuration had to carry — a helper to read
163
+ the method name off a ts-morph node, a `resolve` that returns nothing, one comparison.
164
+ The strategy is still named, and its volume is still reported.
165
+ - The configuration stub no longer echoes defaults.
166
+
167
+ ### Documented
168
+
169
+ - counting-decisions §6 now describes what the code does for output DETs, row by row,
170
+ and records the two refinements the recounts forced; §4 says plainly that only the
171
+ naming mechanism of the technical filter exists, and why the lookup-structure rule
172
+ was rejected; §9 gains "Declared by origin, not by function"; §10 is the master-detail
173
+ rule, with the cascade measurement that rejected the structural signal; §11 is what
174
+ the count reports because it cannot decide.
175
+ - Five reference fixtures were written before their rules: `transformed_output` (59 FP,
176
+ eight output shapes), `system_timestamps` (18), `mestre_detalhe` (41; 51 with
177
+ grouping off), and additions to `edges_boundary` and `open_object`.
178
+
9
179
  ## 0.5.0
10
180
 
11
181
  **Rule set `afp@1.4.0`.** Two classification defects are fixed and both move numbers,