@codedrifters/configulator 0.0.255 → 0.0.257

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/package.json CHANGED
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "main": "lib/index.js",
50
50
  "license": "MIT",
51
- "version": "0.0.255",
51
+ "version": "0.0.257",
52
52
  "types": "lib/index.d.ts",
53
53
  "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\".",
54
54
  "scripts": {
@@ -0,0 +1,163 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://codedrifters.github.io/packages/schemas/focus.schema.json",
4
+ "title": "focus.json",
5
+ "description": "Focus-scoring engine contract for configulator-based projects. Declares named focus areas (customers, segments, organizations, software, regulations, people) that boost the priority of matching issues at triage time.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "focusAreas"],
9
+ "properties": {
10
+ "schemaVersion": {
11
+ "type": "integer",
12
+ "const": 1,
13
+ "description": "Schema version. Bumped only on backwards-incompatible changes."
14
+ },
15
+ "thresholds": {
16
+ "type": "object",
17
+ "description": "Cumulative focus-score thresholds that map into the priority:* taxonomy.",
18
+ "additionalProperties": false,
19
+ "required": ["high", "medium"],
20
+ "properties": {
21
+ "high": {
22
+ "type": "integer",
23
+ "minimum": 1,
24
+ "description": "Total focus score at or above which an issue is boosted to priority:high."
25
+ },
26
+ "medium": {
27
+ "type": "integer",
28
+ "minimum": 1,
29
+ "description": "Total focus score at or above which an issue holds at priority:medium. Must be less than thresholds.high."
30
+ }
31
+ }
32
+ },
33
+ "agentExpansionRules": {
34
+ "type": "object",
35
+ "description": "Guard-rails on what agents may append to focus.json without human review. Append-only: agents never modify or remove existing entries.",
36
+ "additionalProperties": false,
37
+ "required": ["maxWeight", "allowedTypes", "forbiddenTypes"],
38
+ "properties": {
39
+ "maxWeight": {
40
+ "type": "integer",
41
+ "minimum": 1,
42
+ "description": "Hard cap on the weight an agent may set on a newly appended focus area."
43
+ },
44
+ "allowedTypes": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "string",
48
+ "minLength": 1
49
+ },
50
+ "uniqueItems": true,
51
+ "description": "Whitelist of FocusArea.type values agents are permitted to introduce."
52
+ },
53
+ "forbiddenTypes": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "string",
57
+ "minLength": 1
58
+ },
59
+ "uniqueItems": true,
60
+ "description": "Blocklist of FocusArea.type values agents must never introduce. Wins on conflict with allowedTypes."
61
+ },
62
+ "maxKeywords": {
63
+ "type": "integer",
64
+ "minimum": 1,
65
+ "description": "Optional cap on the number of entries in each keyword array (labels, titleKeywords, bodyKeywords) on an agent-appended focus area."
66
+ }
67
+ }
68
+ },
69
+ "focusAreas": {
70
+ "type": "array",
71
+ "description": "Ordered list of scored focus areas. Order is not significant — each area contributes its weight independently when its match predicate fires.",
72
+ "items": { "$ref": "#/$defs/focusArea" }
73
+ }
74
+ },
75
+ "$defs": {
76
+ "focusArea": {
77
+ "type": "object",
78
+ "additionalProperties": false,
79
+ "required": ["name", "type", "source", "match", "weight"],
80
+ "properties": {
81
+ "name": {
82
+ "type": "string",
83
+ "minLength": 1,
84
+ "description": "Human-readable name for the focus area (e.g. 'Acme Corp')."
85
+ },
86
+ "type": {
87
+ "type": "string",
88
+ "minLength": 1,
89
+ "description": "Consuming-repo-defined vocabulary (e.g. 'customer', 'segment', 'organization', 'software', 'regulation', 'person')."
90
+ },
91
+ "source": {
92
+ "type": "string",
93
+ "enum": ["human", "agent"],
94
+ "description": "Provenance. 'human' entries are curated by a maintainer; 'agent' entries were appended by an agent under the agent-expansion rules and must carry discoveredIn."
95
+ },
96
+ "discoveredIn": {
97
+ "type": "string",
98
+ "pattern": "^#\\d+$",
99
+ "description": "Issue reference (e.g. '#123') that introduced the focus area. Required when source='agent'."
100
+ },
101
+ "match": { "$ref": "#/$defs/focusAreaMatch" },
102
+ "weight": {
103
+ "type": "integer",
104
+ "minimum": 1,
105
+ "description": "Positive integer weight contributed to the issue's focus score when the match fires."
106
+ }
107
+ },
108
+ "allOf": [
109
+ {
110
+ "if": {
111
+ "properties": { "source": { "const": "agent" } },
112
+ "required": ["source"]
113
+ },
114
+ "then": {
115
+ "required": ["discoveredIn"]
116
+ }
117
+ }
118
+ ]
119
+ },
120
+ "focusAreaMatch": {
121
+ "type": "object",
122
+ "additionalProperties": false,
123
+ "description": "Match predicate. At least one sub-field should be set; multiple sub-fields combine as a logical OR.",
124
+ "properties": {
125
+ "labels": {
126
+ "type": "array",
127
+ "items": {
128
+ "type": "string",
129
+ "minLength": 1
130
+ },
131
+ "minItems": 1,
132
+ "uniqueItems": true,
133
+ "description": "Any of these labels present on the issue matches."
134
+ },
135
+ "titleKeywords": {
136
+ "type": "array",
137
+ "items": {
138
+ "type": "string",
139
+ "minLength": 1
140
+ },
141
+ "minItems": 1,
142
+ "uniqueItems": true,
143
+ "description": "Case-insensitive substrings matched against the issue title."
144
+ },
145
+ "bodyKeywords": {
146
+ "type": "array",
147
+ "items": {
148
+ "type": "string",
149
+ "minLength": 1
150
+ },
151
+ "minItems": 1,
152
+ "uniqueItems": true,
153
+ "description": "Case-insensitive substrings matched against the issue body."
154
+ }
155
+ },
156
+ "anyOf": [
157
+ { "required": ["labels"] },
158
+ { "required": ["titleKeywords"] },
159
+ { "required": ["bodyKeywords"] }
160
+ ]
161
+ }
162
+ }
163
+ }