trackfw 2.5.3 → 2.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trackfw",
3
- "version": "2.5.3",
3
+ "version": "2.6.0",
4
4
  "description": "CLI de governança para entrega de software: ADR → REQ → ROADMAP → kanban. Suporte nativo a agentes de IA (Claude Code, Gemini CLI, Cursor).",
5
5
  "keywords": [
6
6
  "cli",
@@ -99,7 +99,27 @@ function getContext(format) {
99
99
  }
100
100
 
101
101
  // REQs
102
- const reqs = collectEntries(cfg.reqDir || 'docs/req', 'REQ')
102
+ const reqs = []
103
+ const reqDir = cfg.reqDir || cfg.req_dir || 'docs/req'
104
+ const reqNamespacing = cfg.roadmapNamespacing || cfg.roadmap_namespacing || ''
105
+ if (reqNamespacing === 'by_agent') {
106
+ const STATES = ['backlog', 'wip', 'blocked', 'done', 'abandoned']
107
+ let agents = cfg.agents || []
108
+ if (!agents.length) {
109
+ try {
110
+ agents = fs.readdirSync(reqDir).filter(f => {
111
+ try { return fs.statSync(path.join(reqDir, f)).isDirectory() } catch (_) { return false }
112
+ })
113
+ } catch (_) {}
114
+ }
115
+ for (const agent of agents) {
116
+ for (const state of STATES) {
117
+ reqs.push(...collectEntries(path.join(reqDir, agent, state), 'REQ', state))
118
+ }
119
+ }
120
+ } else {
121
+ reqs.push(...collectEntries(reqDir, 'REQ'))
122
+ }
103
123
 
104
124
  // Roadmaps
105
125
  const roadmaps = []
@@ -818,11 +818,12 @@ async function validateUnfiltered() {
818
818
  applyRule('filename_uniqueness', validateFilenameUniqueness(), violations, warnings)
819
819
  applyRule('blocked_by_draft_adr', validateREQsNotBlockedByDraftADRs(), violations, warnings)
820
820
 
821
- // Regras diretas (sem configuração de severidade): violations sempre
822
- // Popular _itemMeta manualmente para manter rastreabilidade no JSON
823
- for (const msg of validateREQsHaveADR()) { _setMeta(msg, 'req_has_adr'); violations.push(msg) }
824
- for (const msg of validateBlockedHasREQ()) { _setMeta(msg, 'blocked_has_req'); violations.push(msg) }
825
- for (const msg of validateREQsHaveRoadmap()) { _setMeta(msg, 'req_has_roadmap'); violations.push(msg) }
821
+ // Regras configuráveis via applyRule (popula _itemMeta automaticamente)
822
+ applyRule('req_has_adr', validateREQsHaveADR(), violations, warnings)
823
+ applyRule('blocked_has_req', validateBlockedHasREQ(), violations, warnings)
824
+ applyRule('req_has_roadmap', validateREQsHaveRoadmap(), violations, warnings)
825
+
826
+ // Regra direta (sem configuração de severidade): violation sempre
826
827
  for (const msg of validateFrontmatterPresence()) { _setMeta(msg, 'frontmatter_presence'); violations.push(msg) }
827
828
 
828
829
  // warnings diretos do WIP limit (não configuráveis)