pierre-review 0.1.84 → 0.1.86

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 CHANGED
@@ -1,13 +1,102 @@
1
- MIT License
1
+ # Functional Source License, Version 1.1, MIT Future License
2
2
 
3
- Copyright (c) 2026 Alex Wakeman
3
+ ## Abbreviation
4
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:
5
+ FSL-1.1-MIT
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Alex Wakeman
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the MIT license that is effective on the second anniversary of the date we make
91
+ the Software available. On or after that date, you may use the Software under
92
+ the MIT license, in which case the following will apply:
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
95
+ this software and associated documentation files (the "Software"), to deal in
96
+ the Software without restriction, including without limitation the rights to
97
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
98
+ of the Software, and to permit persons to whom the Software is furnished to do
99
+ so, subject to the following conditions:
11
100
 
12
101
  The above copyright notice and this permission notice shall be included in all
13
102
  copies or substantial portions of the Software.
package/README.md CHANGED
@@ -92,4 +92,7 @@ locally instead — a larger database, but PR detail then works fully offline.
92
92
 
93
93
  ## License
94
94
 
95
- MIT
95
+ Source-available under the **Functional Source License (FSL-1.1-MIT)** — see
96
+ [LICENSE](./LICENSE). You may use, self-host, and modify Pierre freely; you may
97
+ **not** offer it as a competing commercial or hosted product. Each release
98
+ automatically converts to the **MIT License** two years after its publication.
@@ -1,4 +1,4 @@
1
- import { getInsights, getRepoAnalytics } from '../../db/queries.js';
1
+ import { getInsights, getRepoAnalytics, getTeamMetricsDetail, getTeamMetricsForScope, resolveScopeRepoIds, } from '../../db/queries.js';
2
2
  import { accountIdOf } from '../plugins/auth.js';
3
3
  function parseIntList(raw) {
4
4
  if (!raw)
@@ -19,6 +19,25 @@ export async function insightsRoutes(app) {
19
19
  repoIds: parseIntList(q.repoIds),
20
20
  });
21
21
  });
22
+ // Team flow-metric header (DORA-ish tiles + trend charts) — CORE/free (moved out of the Pro
23
+ // Insights pane into the Feed). `scope` ('all'|'none'|'teams'|'<teamId>') resolves to repo ids
24
+ // like the rest of the app; null/'all' → the watched set.
25
+ app.get('/api/team-metrics', async (req) => {
26
+ const q = req.query;
27
+ const accountId = accountIdOf(req);
28
+ const scopeRepoIds = q.scope ? await resolveScopeRepoIds(accountId, q.scope) : null;
29
+ return { metrics: await getTeamMetricsForScope(accountId, scopeRepoIds) };
30
+ });
31
+ // The PR lists behind each flow-metric tile (the tile drill-down) — also CORE/free now, so a
32
+ // Feed tile opens the same drill-down for everyone. Mirrors the Pro route's `{enabled, detail}`
33
+ // shape (enabled always true here).
34
+ app.get('/api/team-metrics/detail', async (req) => {
35
+ const q = req.query;
36
+ const accountId = accountIdOf(req);
37
+ const scopeRepoIds = q.scope ? await resolveScopeRepoIds(accountId, q.scope) : null;
38
+ const detail = await getTeamMetricsDetail(accountId, undefined, scopeRepoIds);
39
+ return { enabled: true, detail };
40
+ });
22
41
  // Heavier per-repo analytics for the drill-down chart panel — loaded on demand.
23
42
  // Ownership-scoped: a repo not owned by the account 404s.
24
43
  app.get('/api/insights/:repoId/analytics', async (req, reply) => {
@@ -0,0 +1,9 @@
1
+ -- Part A: deterministic "was this thread addressed?" upgrade. Store a graded addressed-confidence
2
+ -- + a machine reason tag + who resolved the thread, alongside the existing derivedState. All
3
+ -- additive (defaulted / nullable) so the backfill is a no-op — the next sync recomputes them.
4
+ -- The Postgres baseline is regenerated separately via `pnpm db:generate:pg`.
5
+ ALTER TABLE `review_threads` ADD `addressed_confidence` text DEFAULT 'none' NOT NULL;
6
+ --> statement-breakpoint
7
+ ALTER TABLE `review_threads` ADD `addressed_reason` text;
8
+ --> statement-breakpoint
9
+ ALTER TABLE `review_threads` ADD `resolved_by_login` text;
@@ -232,6 +232,13 @@
232
232
  "when": 1783820880005,
233
233
  "tag": "0032_benchmark_contributions",
234
234
  "breakpoints": true
235
+ },
236
+ {
237
+ "idx": 33,
238
+ "version": "6",
239
+ "when": 1784200000000,
240
+ "tag": "0033_thread_addressed_confidence",
241
+ "breakpoints": true
235
242
  }
236
243
  ]
237
244
  }
@@ -0,0 +1,3 @@
1
+ ALTER TABLE "review_threads" ADD COLUMN "addressed_confidence" text DEFAULT 'none' NOT NULL;--> statement-breakpoint
2
+ ALTER TABLE "review_threads" ADD COLUMN "addressed_reason" text;--> statement-breakpoint
3
+ ALTER TABLE "review_threads" ADD COLUMN "resolved_by_login" text;