@orkastery/cli 0.5.1 → 0.5.6
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/adapters/claude-code/README.md +158 -0
- package/adapters/claude-code/agents/ork-master.md +2 -0
- package/adapters/claude-code/commands/master.md +8 -0
- package/adapters/claude-code/commands/ork.md +9 -0
- package/adapters/claude-code/mods/autoridade.json +56 -0
- package/adapters/claude-code/mods/ork-clima/.claude-plugin/plugin.json +14 -0
- package/adapters/claude-code/mods/ork-clima/hooks/contas.ts +283 -0
- package/adapters/claude-code/mods/ork-clima/hooks/hooks.json +3 -0
- package/adapters/claude-code/mods/ork-clima/hooks/previsao.ts +393 -0
- package/adapters/claude-code/mods/ork-clima/hooks/register.ts +205 -0
- package/adapters/claude-code/mods/ork-clima/orkastery-mod.json +5 -0
- package/adapters/claude-code/mods/ork-clima/types/index.d.ts +80 -0
- package/adapters/claude-code/mods/ork-freio/.claude-plugin/plugin.json +14 -0
- package/adapters/claude-code/mods/ork-freio/hooks/carga.ts +160 -0
- package/adapters/claude-code/mods/ork-freio/hooks/conferencia.ts +309 -0
- package/adapters/claude-code/mods/ork-freio/hooks/hooks.json +3 -0
- package/adapters/claude-code/mods/ork-freio/hooks/lote.ts +270 -0
- package/adapters/claude-code/mods/ork-freio/hooks/register.ts +285 -0
- package/adapters/claude-code/mods/ork-freio/orkastery-mod.json +5 -0
- package/adapters/claude-code/mods/ork-freio/types/index.d.ts +127 -0
- package/adapters/claude-code/mods/ork-mesa/.claude-plugin/plugin.json +14 -0
- package/adapters/claude-code/mods/ork-mesa/hooks/cartoes.tsx +246 -0
- package/adapters/claude-code/mods/ork-mesa/hooks/decidir.ts +110 -0
- package/adapters/claude-code/mods/ork-mesa/hooks/fila.ts +253 -0
- package/adapters/claude-code/mods/ork-mesa/hooks/hooks.json +3 -0
- package/adapters/claude-code/mods/ork-mesa/hooks/obvia.ts +98 -0
- package/adapters/claude-code/mods/ork-mesa/hooks/register.tsx +493 -0
- package/adapters/claude-code/mods/ork-mesa/orkastery-mod.json +5 -0
- package/adapters/claude-code/mods/ork-mesa/types/index.d.ts +131 -0
- package/adapters/claude-code/mods/ork-pista/.claude-plugin/plugin.json +14 -0
- package/adapters/claude-code/mods/ork-pista/hooks/acoes.ts +71 -0
- package/adapters/claude-code/mods/ork-pista/hooks/ci.ts +117 -0
- package/adapters/claude-code/mods/ork-pista/hooks/hooks.json +3 -0
- package/adapters/claude-code/mods/ork-pista/hooks/pista.tsx +356 -0
- package/adapters/claude-code/mods/ork-pista/hooks/register.tsx +439 -0
- package/adapters/claude-code/mods/ork-pista/orkastery-mod.json +5 -0
- package/adapters/claude-code/mods/ork-pista/types/index.d.ts +85 -0
- package/adapters/claude-code/mods/ork-ponte/.claude-plugin/plugin.json +13 -0
- package/adapters/claude-code/mods/ork-ponte/hooks/faixa.tsx +57 -0
- package/adapters/claude-code/mods/ork-ponte/hooks/guarda.ts +410 -0
- package/adapters/claude-code/mods/ork-ponte/hooks/hooks.json +3 -0
- package/adapters/claude-code/mods/ork-ponte/hooks/mostrado.ts +55 -0
- package/adapters/claude-code/mods/ork-ponte/hooks/nucleo.ts +157 -0
- package/adapters/claude-code/mods/ork-ponte/hooks/papel.ts +42 -0
- package/adapters/claude-code/mods/ork-ponte/hooks/register.ts +331 -0
- package/adapters/claude-code/mods/ork-ponte/hooks/vigia.ts +76 -0
- package/adapters/claude-code/mods/ork-ponte/orkastery-mod.json +5 -0
- package/adapters/claude-code/mods/ork-ponte/types/index.d.ts +178 -0
- package/adapters/claude-code/mods/ork-portao/.claude-plugin/plugin.json +14 -0
- package/adapters/claude-code/mods/ork-portao/hooks/hooks.json +3 -0
- package/adapters/claude-code/mods/ork-portao/hooks/lease.ts +201 -0
- package/adapters/claude-code/mods/ork-portao/hooks/plano.ts +304 -0
- package/adapters/claude-code/mods/ork-portao/hooks/register.ts +339 -0
- package/adapters/claude-code/mods/ork-portao/hooks/verify.ts +152 -0
- package/adapters/claude-code/mods/ork-portao/orkastery-mod.json +5 -0
- package/adapters/claude-code/mods/ork-portao/types/index.d.ts +60 -0
- package/adapters/claude-code/mods/ork-radar/.claude-plugin/plugin.json +14 -0
- package/adapters/claude-code/mods/ork-radar/hooks/colisao.ts +420 -0
- package/adapters/claude-code/mods/ork-radar/hooks/hooks.json +3 -0
- package/adapters/claude-code/mods/ork-radar/hooks/mapa.tsx +322 -0
- package/adapters/claude-code/mods/ork-radar/hooks/register.tsx +470 -0
- package/adapters/claude-code/mods/ork-radar/orkastery-mod.json +5 -0
- package/adapters/claude-code/mods/ork-radar/types/index.d.ts +72 -0
- package/adapters/claude-code/mods/ork-sentinela/.claude-plugin/plugin.json +14 -0
- package/adapters/claude-code/mods/ork-sentinela/hooks/alertas.ts +85 -0
- package/adapters/claude-code/mods/ork-sentinela/hooks/despacho.ts +156 -0
- package/adapters/claude-code/mods/ork-sentinela/hooks/hooks.json +3 -0
- package/adapters/claude-code/mods/ork-sentinela/hooks/register.ts +511 -0
- package/adapters/claude-code/mods/ork-sentinela/hooks/vigia.ts +186 -0
- package/adapters/claude-code/mods/ork-sentinela/orkastery-mod.json +5 -0
- package/adapters/claude-code/mods/ork-sentinela/types/index.d.ts +65 -0
- package/adapters/claude-code/mods/ork-torre/.claude-plugin/plugin.json +14 -0
- package/adapters/claude-code/mods/ork-torre/hooks/agenda.ts +60 -0
- package/adapters/claude-code/mods/ork-torre/hooks/detalhe.tsx +236 -0
- package/adapters/claude-code/mods/ork-torre/hooks/frases.ts +42 -0
- package/adapters/claude-code/mods/ork-torre/hooks/hooks.json +3 -0
- package/adapters/claude-code/mods/ork-torre/hooks/painel.tsx +344 -0
- package/adapters/claude-code/mods/ork-torre/hooks/rede.ts +97 -0
- package/adapters/claude-code/mods/ork-torre/hooks/register.tsx +437 -0
- package/adapters/claude-code/mods/ork-torre/orkastery-mod.json +5 -0
- package/adapters/claude-code/mods/ork-torre/types/index.d.ts +108 -0
- package/adapters/codex/skills/ork/SKILL.md +18 -3
- package/adapters/hermes/README.md +1 -0
- package/adapters/hermes/bin/ork-network-status.sh +10 -0
- package/adapters/hermes/hermes.plugin.json +1 -0
- package/adapters/hermes/hitl-ingress/__init__.py +2 -2
- package/adapters/hermes/skills/orkastery-devmaster/SKILL.md +7 -6
- package/adapters/openclaw/README.md +26 -5
- package/adapters/openclaw/dist/hitl-ingress.js +2 -2
- package/adapters/openclaw/dist/index.js +46 -11
- package/adapters/openclaw/openclaw.plugin.json +5 -1
- package/adapters/openclaw/package.json +2 -2
- package/adapters/openclaw/src/hitl-ingress.ts +2 -2
- package/adapters/openclaw/src/index.ts +49 -11
- package/assets/docs-en/markdownlint-cli2.jsonc +22 -0
- package/assets/docs-en/padroes/documentacao-de-produto.md +135 -0
- package/assets/docs-en/padroes/roadmap-de-produto.md +100 -0
- package/assets/docs-en/produto/README.md +14 -0
- package/assets/docs-en/produto/_modelo-feature.md +62 -0
- package/assets/docs-en/roadmap/README.md +14 -0
- package/assets/docs-en/roadmap/_modelo-item.md +75 -0
- package/assets/orkmind_bridge.py +117 -9
- package/dist/adapters/claude-bg.js +116 -18
- package/dist/adapters/codex.js +14 -4
- package/dist/agents-md.js +24 -14
- package/dist/auditrun.js +22 -3
- package/dist/board.js +20 -17
- package/dist/branch-de-estado.js +88 -10
- package/dist/busca-semantica.js +52 -12
- package/dist/canarios-rm057.js +149 -0
- package/dist/canarios.js +2 -0
- package/dist/catalogo.js +33 -0
- package/dist/ci.js +21 -8
- package/dist/claims-conferir.js +342 -0
- package/dist/claims.js +41 -1
- package/dist/company-brain-client.js +36 -1
- package/dist/company-brain-context.js +158 -22
- package/dist/company-brain-journal.js +2 -1
- package/dist/company-brain-migration.js +36 -1
- package/dist/conducao-sentinela.js +388 -0
- package/dist/conducao-texto.js +12 -18
- package/dist/conducao.js +122 -30
- package/dist/conhecimento.js +490 -0
- package/dist/docs.js +70 -17
- package/dist/doctor-pulse-cron.js +349 -0
- package/dist/doctor-rede.js +150 -0
- package/dist/doctor.js +195 -111
- package/dist/entrega-pr.js +42 -29
- package/dist/escopo-escrita.js +10 -1
- package/dist/esgotamentos.js +181 -0
- package/dist/estado-thread.js +23 -1
- package/dist/experiencia-instalacao.js +45 -25
- package/dist/experiencia.js +12 -2
- package/dist/fabrica-batida.js +310 -0
- package/dist/fabrica-estado.js +52 -14
- package/dist/fabrica-publicar.js +9 -1
- package/dist/fechamento.js +20 -66
- package/dist/fila-pesada.js +444 -0
- package/dist/fix.js +3 -2
- package/dist/forja.js +31 -7
- package/dist/gates.js +3 -24
- package/dist/handoff.js +10 -6
- package/dist/hitl-contract.js +59 -4
- package/dist/hitl-curto.js +11 -6
- package/dist/hitl-gates.js +5 -0
- package/dist/hitl-local-receipt.js +2 -0
- package/dist/hitl-lote.js +5 -2
- package/dist/hitl-resumo.js +38 -3
- package/dist/hitl-tempo-parado.js +201 -0
- package/dist/hitl-texto-livre.js +5 -5
- package/dist/hitl.js +29 -33
- package/dist/horario.js +41 -7
- package/dist/hosts.js +104 -11
- package/dist/impedimento.js +299 -0
- package/dist/index.js +961 -542
- package/dist/indice-vetorial.js +87 -10
- package/dist/indice.js +9 -1
- package/dist/init.js +56 -43
- package/dist/instabilidade.js +144 -0
- package/dist/integracoes-locais.js +4 -0
- package/dist/intelligence-graph-cli.js +170 -16
- package/dist/intelligence-graph-contexto.js +254 -0
- package/dist/intelligence-graph-contract.js +2 -1
- package/dist/intelligence-graph-extract-md.js +56 -4
- package/dist/intelligence-graph-extract-ts.js +71 -3
- package/dist/intelligence-graph-parsers.js +6 -4
- package/dist/intelligence-graph-query.js +66 -19
- package/dist/leases.js +664 -87
- package/dist/ledger-stats.js +15 -1
- package/dist/ledger.js +18 -1
- package/dist/licoes.js +1 -0
- package/dist/liveness.js +6 -3
- package/dist/locale-ajuda.js +761 -0
- package/dist/locale-gerados.js +160 -0
- package/dist/locale-master.js +99 -0
- package/dist/locale-onboarding.js +92 -0
- package/dist/locale-phase.js +151 -0
- package/dist/locale-pulse.js +211 -0
- package/dist/locale-retry.js +385 -0
- package/dist/locale-roadmap.js +102 -0
- package/dist/locale-ship.js +494 -0
- package/dist/locale-thread.js +277 -0
- package/dist/locale-verify.js +125 -0
- package/dist/locale.js +714 -0
- package/dist/maestro-runtime.js +4 -1
- package/dist/manifest.js +149 -4
- package/dist/maquina.js +23 -4
- package/dist/master-digest.js +6 -1
- package/dist/master-nota.js +18 -11
- package/dist/master.js +145 -31
- package/dist/mcp-artifacts.js +43 -3
- package/dist/mcp-git.js +42 -8
- package/dist/mcp-grafo-worker.js +5 -3
- package/dist/mcp-grafo.js +55 -6
- package/dist/mcp-server.js +22 -3
- package/dist/mcp-ship.js +3 -1
- package/dist/mcp-verify.js +6 -1
- package/dist/memoria.js +48 -6
- package/dist/modos.js +3 -6
- package/dist/network-roadmap.js +196 -18
- package/dist/noctum-arco.js +911 -0
- package/dist/noctum-capacidade.js +141 -0
- package/dist/noctum-envelope.js +810 -0
- package/dist/noctum-execucao.js +304 -0
- package/dist/noctum-fila.js +280 -0
- package/dist/ocupacao.js +40 -5
- package/dist/onboarding.js +40 -21
- package/dist/orkmind.js +99 -7
- package/dist/orquestracao.js +24 -21
- package/dist/parado-no-condutor.js +219 -38
- package/dist/phase.js +160 -52
- package/dist/policies.js +56 -5
- package/dist/portfolio.js +8 -3
- package/dist/postura-local.js +234 -0
- package/dist/preflight.js +11 -10
- package/dist/procedencia.js +225 -0
- package/dist/projeto-alvo.js +132 -5
- package/dist/prompts.js +40 -1
- package/dist/prova-ativacao.js +75 -6
- package/dist/pulse-delivery.js +47 -4
- package/dist/pulse.js +98 -19
- package/dist/ratelimit.js +24 -6
- package/dist/recall.js +3 -1
- package/dist/redacao-saida.js +63 -0
- package/dist/rede-adesao.js +399 -0
- package/dist/rede-forja.js +289 -0
- package/dist/rede-projetos.js +239 -0
- package/dist/rede-status.js +337 -0
- package/dist/rede.js +980 -0
- package/dist/retry.js +291 -140
- package/dist/roadmap-reservas.js +20 -3
- package/dist/roadmap-status.js +150 -34
- package/dist/runtime-context.js +181 -3
- package/dist/runtime-profiles.js +22 -1
- package/dist/runtimes.js +2 -1
- package/dist/saida-segura.js +58 -0
- package/dist/session-events.js +7 -3
- package/dist/session-watcher-claude.js +120 -24
- package/dist/session-watcher.js +185 -33
- package/dist/sessoes-contas.js +187 -0
- package/dist/sessoes-inventario.js +6 -18
- package/dist/sessoes.js +83 -2
- package/dist/ship-publicar.js +800 -0
- package/dist/ship.js +157 -88
- package/dist/steal.js +77 -0
- package/dist/thread-close.js +3 -2
- package/dist/thread.js +299 -49
- package/dist/util.js +8 -1
- package/dist/verify.js +141 -52
- package/dist/vida-da-thread.js +254 -0
- package/dist/worktree-local.js +165 -0
- package/dist/worktree.js +25 -2
- package/dist/yaml.js +27 -8
- package/eval/fixtures/fx-pedido-colado/caso.json +20 -0
- package/package.json +7 -3
- package/references/definition-of-done.md +1 -1
- package/schemas/code-artifact-graph.v1.schema.json +2 -1
- package/skills/README.md +1 -1
- package/skills/core/orkastery-bootstrap/SKILL.md +2 -2
- package/skills/phases/master-metrics/SKILL.md +8 -3
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Software product documentation standard
|
|
2
|
+
|
|
3
|
+
> Version 1.1 · Applies to: platforms, systems, modules and features · Companion document: [Product roadmap standard](roadmap-de-produto.md)
|
|
4
|
+
>
|
|
5
|
+
> Version 1.1 keeps 1.0 and adds section 6 (three readers and SDLC facts) and the template frontmatter, which `ork docs verificar` checks.
|
|
6
|
+
|
|
7
|
+
The frontmatter keys and values, the section titles of the page templates and the `> **Em uma frase:**` line stay in Portuguese in every language, because they are the contract that `ork docs verificar` reads.
|
|
8
|
+
|
|
9
|
+
## 1. Purpose and documentation unit
|
|
10
|
+
|
|
11
|
+
This standard describes **the product and its verifiable behavior**, from the platform context to the technical contracts. Create one page per relevant entity; a feature (`Feature`) is the recommended unit for specifying behavior. Lengthy details, such as OpenAPI contracts and data schemas, can live in their own files, linked by stable identifiers.
|
|
12
|
+
|
|
13
|
+
Use the hierarchy `Platform → System/Service → Module → Submodule/Domain → Feature`. A use case belongs to a feature; an operation represents an action of that feature. Entities and fields describe data; APIs, endpoints, events, triggers and jobs describe interfaces and execution. The same service or contract can serve several features: keep one canonical source and reference it, without copying divergent definitions.
|
|
14
|
+
|
|
15
|
+
The **roadmap** records the problems, hypotheses, choices, priorities and progress of changes. This documentation records current behavior and, when needed, future specification explicitly identified as such. Relate both through IDs and links; do not treat a proposal as an already delivered feature.
|
|
16
|
+
|
|
17
|
+
## 2. Mandatory conventions
|
|
18
|
+
|
|
19
|
+
| Rule | How to apply |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| Identity | Assign stable IDs, for example `PLAT-01`, `SYS-01`, `MOD-01`, `FEAT-042`, `UC-042-01`, `BR-042-01`, `API-01`, `EVT-01`, `JOB-01` and `RM-042`. Renaming does not change the ID. In Orkastery, the number of a new FEAT comes from `ork roadmap feat`, reserved across machines; never from the highest number on your branch. |
|
|
22
|
+
| Scope and state | Say whether what the page describes is `vigente` (current), `em desenvolvimento` (in development), `proposto` (proposed) or `descontinuado` (discontinued), with environment, version and verification date. |
|
|
23
|
+
| Traceability | Link feature ↔ roadmap item ↔ use cases/rules ↔ contracts/schemas ↔ code/PR ↔ tests/evidence ↔ release. Use `Not applicable: reason` when a section does not make sense. |
|
|
24
|
+
| Source | Distinguish `confirmed` (code, contract, test or approved decision), `planned` (roadmap item) and `to be validated`. Never fill a gap by silent inference. |
|
|
25
|
+
| Form | Use clear language, in the language the product's docs are written in; keep the exact names of code, endpoints, flags and events in backticks. Dates in ISO 8601 with time zone; explicit units. |
|
|
26
|
+
| Responsibility | Record the page's human owner, the technical approver when applicable and the last review. An AI agent can propose changes, with source and human review defined by the team. |
|
|
27
|
+
| History | Behavior changes require updating the page and linking it to the roadmap item/release; relevant technical decisions point to an ADR. |
|
|
28
|
+
|
|
29
|
+
## 3. Documentation categories
|
|
30
|
+
|
|
31
|
+
Fill in the applicable fields. For reusable entities, create their own pages and link their IDs to the feature page.
|
|
32
|
+
|
|
33
|
+
### 3.1 Context and architecture
|
|
34
|
+
|
|
35
|
+
| Field | What to record |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| Platform; system/service; module; submodule | IDs, names and links to their respective parents. |
|
|
38
|
+
| Purpose; boundaries | Problem addressed, the component's responsibility and what does not belong to it. |
|
|
39
|
+
| Dependencies | Internal/external services and impact in case of failure. |
|
|
40
|
+
| Repository; code location | URL, directories and reference version/commit. |
|
|
41
|
+
| Deployment; environments | Deploy model, environments and regions actually used. |
|
|
42
|
+
| Isolation; configuration | Tenancy model and system parameters; cite names, effect, default and environment, never secret values. |
|
|
43
|
+
| Retention | Data types, retention period, disposal and approved policy/decision. |
|
|
44
|
+
|
|
45
|
+
### 3.2 Features and behavior
|
|
46
|
+
|
|
47
|
+
| Field | What to record |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| Feature; actors/personas | ID, purpose, participating users and systems. |
|
|
50
|
+
| Use cases; operations | IDs and names; CRUD operations and business actions kept separate. |
|
|
51
|
+
| Preconditions; trigger | Required state and the action/event that starts the flow. |
|
|
52
|
+
| Main flow; alternatives | Observable steps and paths for error, cancellation, timeout and recovery. |
|
|
53
|
+
| Postconditions | Persisted changes, emitted messages and external effects. |
|
|
54
|
+
| Business rules | Atomic rule with ID, condition, result and exceptions. |
|
|
55
|
+
| Acceptance criteria | Testable scenarios, preferably Given/When/Then, linked to the rules. |
|
|
56
|
+
| Interface | Screens, components, states, accessibility and a reference to the approved prototype. |
|
|
57
|
+
|
|
58
|
+
### 3.3 Data and fields
|
|
59
|
+
|
|
60
|
+
Define each entity once. For each field, record `technical name`, `label`, `type`, `unit`, `required`, `nullability`, `limits`, `validation`, `format/mask`, `default value`, `sensitivity classification`, `retention` and `source/destination`. Explain differences between the UI, API and database representations; for example, `refund_amount_cents` is an integer in cents and appears as currency in the interface. Relate the table/migration/schema and the contract version. Do not use a format regex as proof that a document number is semantically valid.
|
|
61
|
+
|
|
62
|
+
### 3.4 APIs and integrations
|
|
63
|
+
|
|
64
|
+
Record `API/integration`, `protocol and version`, `provider/consumer`, `method and endpoint`, `path/query/header params`, `authentication`, `authorization`, `request`, `success response`, `errors`, `pagination`, `usage limits`, `timeout`, `idempotency`, `compatibility` and a link to the OpenAPI or canonical contract. Include sanitized examples without credentials; spell out the behavior on failures and with previous versions.
|
|
65
|
+
|
|
66
|
+
### 3.5 Events, triggers and scheduled tasks
|
|
67
|
+
|
|
68
|
+
Record `event ID/name/version`, `producer`, `trigger`, `payload/schema`, `broker/topic`, `consumers`, `delivery/ordering`, `retry/backoff`, `DLQ`, `idempotency`, `observability` and `retention`. For jobs, include `ID`, `owner`, `schedule expression`, `time zone`, `timeout`, `concurrency`, `effects`, `retry` and the reprocessing procedure. A cron in UTC needs a readable description and a time zone reference.
|
|
69
|
+
|
|
70
|
+
### 3.6 Observability and operations
|
|
71
|
+
|
|
72
|
+
Record `correlation_id/trace_id`, logs and allowed fields, technical and business metrics, SLI/SLO with a measurement window, alerts and thresholds, dashboards, error tracking, health checks, runbook, audit events and expected impact on cost/capacity. Distinguish a service objective (SLO) from a contractual commitment (SLA).
|
|
73
|
+
|
|
74
|
+
### 3.7 Security, governance and compliance
|
|
75
|
+
|
|
76
|
+
Record risk, roles and the permission matrix (RBAC/ABAC), authentication/session, encryption and secrets management, handling of personal data, masking in logs, input validation, origin policies when there is a browser, applicable regulatory requirements, maintenance window and rollback procedure. Cite internal policies and approved decisions instead of assuming that every cited regulation applies.
|
|
77
|
+
|
|
78
|
+
## 4. Feature page template
|
|
79
|
+
|
|
80
|
+
Reserve the number with `ork roadmap feat --thread <thread>` and copy [the template](../produto/_modelo-feature.md) for each feature; replace the brackets with values or with `Not applicable: reason`. The frontmatter is the layer that agents and the checker read; the body is the layer that people read. Add tables of fields and contracts when there are several elements.
|
|
81
|
+
|
|
82
|
+
Frontmatter keys of a feature:
|
|
83
|
+
|
|
84
|
+
| Key | Content | Checked by `ork docs verificar` |
|
|
85
|
+
| --- | --- | --- |
|
|
86
|
+
| `id`, `tipo`, `titulo` | `FEAT-000`, `feature`, name | ID format, file name, uniqueness |
|
|
87
|
+
| `estado` | `vigente`, `em desenvolvimento`, `proposto` or `descontinuado` | value from the standard |
|
|
88
|
+
| `pai` | `MOD-00` | exists and is from the level above |
|
|
89
|
+
| `roadmap` | list of `RM-000` | exists, and the item cites the feature back |
|
|
90
|
+
| `owner`, `aprovador` | people | presence |
|
|
91
|
+
| `verificado_em`, `versao` | ISO 8601 with time zone; branch@commit | format |
|
|
92
|
+
| `fontes.codigo`, `fontes.testes`, `fontes.docs` | paths relative to the root | **exist in the repository** |
|
|
93
|
+
| `fontes.simbolos` | `file#name` | **the name appears in the file** |
|
|
94
|
+
| `fontes.contratos` | contract IDs (`ork.hitl/v2`) | **appear in `fontes.codigo`** |
|
|
95
|
+
| `fontes.comandos` | commands of the product's CLI | **the CLI declares the command** |
|
|
96
|
+
|
|
97
|
+
## 5. Review and synchronization
|
|
98
|
+
|
|
99
|
+
Before approving a change, check IDs and links, behavior and exceptions, names and types against code/migrations, API/event contracts, permissions, tests and the real environment. Update the documentation together with the implementation change; mark differences as `to be validated` with an owner and a deadline. Automation or an agent can compare sources and prepare a diff, but must record the commit/contract consulted and must not turn an assumption into a fact. Execution status and priority decisions live in the [roadmap standard](roadmap-de-produto.md).
|
|
100
|
+
|
|
101
|
+
In Orkastery, this comparison has an owner and a command:
|
|
102
|
+
|
|
103
|
+
- `ork docs verificar`: runs in CI on every PR; fails a page whose `fontes` no longer exist, or with a broken link, a repeated ID or a forgotten template field.
|
|
104
|
+
- `ork docs sincronizar`: runs on the project's machine; reads the threads' ledger and git and updates **only facts** (merge, phase), never status because time has passed. Without `--escrever`, it only shows what would change.
|
|
105
|
+
- `ork docs init`: creates this structure in any product conducted by Orkastery.
|
|
106
|
+
|
|
107
|
+
## 6. Three readers and SDLC facts (Orkastery adaptation)
|
|
108
|
+
|
|
109
|
+
Every page is read by three readers at the same time. If one of them is left behind, the page has failed.
|
|
110
|
+
|
|
111
|
+
### 6.1 Person with ADHD
|
|
112
|
+
|
|
113
|
+
- **Answer first.** Right below the title, a `> **Em uma frase:**` (in one sentence) line of up to 240 characters.
|
|
114
|
+
- **State at a glance.** State, verification date and version appear before any explanation.
|
|
115
|
+
- **One idea per line.** Bullets instead of paragraphs; a paragraph with more than 600 characters raises a warning.
|
|
116
|
+
- **Sections always have the same names.** Anyone who has read one page knows where everything is on the next.
|
|
117
|
+
- **Nothing silently empty.** A section without content says `Not applicable: reason` or `To be defined: owner, deadline`.
|
|
118
|
+
|
|
119
|
+
### 6.2 Parity checker
|
|
120
|
+
|
|
121
|
+
- The page asserts checkable things: paths, symbols, contracts, commands, commits.
|
|
122
|
+
- A divergence between page and repository is a **lint error**, not a matter of opinion.
|
|
123
|
+
- The checker never fills a gap or infers a state; it only points them out.
|
|
124
|
+
|
|
125
|
+
### 6.3 AI models and agents
|
|
126
|
+
|
|
127
|
+
- YAML frontmatter with fixed keys and values (section 4); stable IDs in the file name and in the title.
|
|
128
|
+
- `ork docs verificar --json` returns the findings with a typed rule (`docs.paridade.fonte`, `docs.leitura.resumo`...).
|
|
129
|
+
- An agent can propose the change; review and decision stay with people (section 2, Responsibility).
|
|
130
|
+
|
|
131
|
+
### 6.4 SDLC facts of the Orkastery method
|
|
132
|
+
|
|
133
|
+
- **Product facts** go into the documentation: the feature is `vigente`, in which version, verified when, against which sources.
|
|
134
|
+
- Delivery progress (thread, phase, CHECK, merge) is recorded in the [roadmap](roadmap-de-produto.md), in the item's `sdlc` section.
|
|
135
|
+
- **Conduction micro-decisions stay out**: which claim was re-registered, which GO-FIX fixed a test, which session dropped. That lives in the thread's ledger.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Software product roadmap standard
|
|
2
|
+
|
|
3
|
+
> Version 1.1 · Applies to: initiatives, epics, features and changes · Companion document: [Product documentation standard](documentacao-de-produto.md)
|
|
4
|
+
>
|
|
5
|
+
> Version 1.1 keeps 1.0 and adds section 6 (three readers and SDLC facts) and the template frontmatter, which `ork docs verificar` checks.
|
|
6
|
+
|
|
7
|
+
The frontmatter keys and values, the section titles of the page templates and the `> **Em uma frase:**` line stay in Portuguese in every language, because they are the contract that `ork docs verificar` reads.
|
|
8
|
+
|
|
9
|
+
## 1. Purpose and tracking unit
|
|
10
|
+
|
|
11
|
+
This standard records **why to change, what is meant to be delivered, how to validate it and what the real state of execution is**. Use one item per traceable investment/delivery decision. Initiatives can contain epics, and epics can contain features; each item has its own ID and points to its parent item. An implemented feature points to its `FEAT-ID` specification. Do not replicate extensive technical fields of the product in the roadmap: keep links to the canonical documentation.
|
|
12
|
+
|
|
13
|
+
The roadmap is a planning view subject to revision. Dates, priorities and scope are commitments only when explicitly approved and identified as such. Mark estimates and hypotheses as such.
|
|
14
|
+
|
|
15
|
+
## 2. Common rules
|
|
16
|
+
|
|
17
|
+
| Rule | How to apply |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| ID and links | Use a stable `RM-001`; state the parent, affected features and links to specifications, ADRs, issue, PR, tests and release. |
|
|
20
|
+
| Outcome | Spell out the problem, audience, objective, measurable hypothesis, baseline, target, window and source of the metric. |
|
|
21
|
+
| Prioritization | Record method, criteria, score and date; priority is distinct from urgency and does not replace a rationale. |
|
|
22
|
+
| Scope | Separate what is included, what is excluded, dependencies and assumptions. Scope changes call for a decision record. |
|
|
23
|
+
| Dates | Distinguish target, forecast and actual date; use ISO 8601, time zone and confidence level. Never infer progress from the date. |
|
|
24
|
+
| Evidence | Give the source and date of each status. Merged PR, deploy and availability to users are distinct facts. |
|
|
25
|
+
| Responsibility | Name a human owner for decision, execution and validation. AI agents can draft, verify or execute within recorded autonomy; assign review and the final decision to people. |
|
|
26
|
+
| Gaps | Use `To be defined` with an owner and a deadline; for an irrelevant section, `Not applicable: reason`. Do not make up status or metrics. |
|
|
27
|
+
|
|
28
|
+
## 3. Roadmap item categories
|
|
29
|
+
|
|
30
|
+
### 3.1 Identification and positioning
|
|
31
|
+
|
|
32
|
+
Record `ID`, `outcome-oriented title`, `type` (initiative, epic, feature or improvement; the `categoria` key takes `iniciativa`, `épico`, `feature` or `melhoria`), `parent item`, `platform`, `system`, `module`, `affected features`, `audience`, `requesting area`, `canonical links` and `page version`. The architectural hierarchy describes where the change happens; the roadmap hierarchy describes how it is planned.
|
|
33
|
+
|
|
34
|
+
### 3.2 Problem, objective and hypothesis
|
|
35
|
+
|
|
36
|
+
Record `problem/opportunity`, `evidence`, `objective/OKR`, `hypothesis in the form If... then... because...`, `main metric`, `guardrail metrics`, `baseline`, `target`, `observation window`, `analysis segment` and `data source`. Without a known baseline, define how it will be measured before declaring success.
|
|
37
|
+
|
|
38
|
+
### 3.3 Scope, deliverables and validation
|
|
39
|
+
|
|
40
|
+
Record `included scope`, `out of scope`, `deliverables`, `affected use cases`, `acceptance criteria`, `experiment/pilot`, `measurement plan`, `criteria to expand/stop`, `operational enablement` and `required documentation`. Point to the IDs of rules, contracts and tests in the product documentation.
|
|
41
|
+
|
|
42
|
+
### 3.4 Prioritization and planning
|
|
43
|
+
|
|
44
|
+
Record `priority`, `method/score` (for example RICE, with explicit factors), `rationale`, `urgency`, `horizon` (Now/Next/Later or quarter), `target date`, `forecast`, `confidence`, `milestones`, `estimated capacity/cost` and `trade-offs`. A score without criteria and a date is not reproducible.
|
|
45
|
+
|
|
46
|
+
### 3.5 Dependencies, risks and decisions
|
|
47
|
+
|
|
48
|
+
Record `dependencies with IDs and owners`, `blockers`, `assumptions not yet validated`, `risks with probability/impact`, `mitigation/contingency`, `product decisions`, `technical ADR`, `discarded alternatives`, `date/decider` and `review trigger`. An ADR is a decision record that can be superseded by another; preserve the history, without erasing earlier decisions.
|
|
49
|
+
|
|
50
|
+
### 3.6 Lifecycle and independent states
|
|
51
|
+
|
|
52
|
+
Do not use a single field to hide differences between plan, code and delivery. Update each dimension separately:
|
|
53
|
+
|
|
54
|
+
| Dimension | Recommended values | Minimum evidence |
|
|
55
|
+
| --- | --- | --- |
|
|
56
|
+
| Item lifecycle | `Discovery` → `Backlog` → `Refinamento` (refinement) → `Pronto para desenvolvimento` (ready for development) → `Em desenvolvimento` (in development) → `Em validação` (in validation) → `Piloto` (pilot) → `Disponível` (available) → `Concluído` (done); side states: `Bloqueado` (blocked), `Cancelado` (canceled), `Descontinuado` (discontinued) | Decision, milestone or delivery with date and owner. |
|
|
57
|
+
| Documentation | `Rascunho` (draft), `Em revisão` (in review), `Aprovada` (approved), `Desatualizada` (outdated) | Link, version and reviewer. |
|
|
58
|
+
| Code | `Não iniciado` (not started), `Branch criada` (branch created), `PR aberto` (PR open), `Mesclado` (merged) | Repository, branch/PR and commit. |
|
|
59
|
+
| Tests | `Não iniciados` (not started), `Em execução` (running), `Aprovados` (passing), `Falhando` (failing) | Run and date; coverage, if relevant. |
|
|
60
|
+
| Deploy | `Não implantado` (not deployed), `Dev`, `Staging`, `Produção` (production) | Pipeline, release and actual date. |
|
|
61
|
+
| Exposure | `Flag desligada` (flag off), `Piloto/Canary` (pilot/canary), `Parcial` (partial), `Geral` (general) | Configuration per environment/cohort and verification. |
|
|
62
|
+
| Enablement | `Pendente` (pending), `Em andamento` (in progress), `Concluída` (done) | Communication, training or published material. |
|
|
63
|
+
|
|
64
|
+
`Bloqueado` requires a reason, a dependency, an owner and a next review. `Concluído` requires met acceptance criteria, evidence of availability and a record of the initial measurement or a post-launch evaluation plan. Status must not be updated merely because time has passed.
|
|
65
|
+
|
|
66
|
+
### 3.7 Owners and collaboration between people and agents
|
|
67
|
+
|
|
68
|
+
Record `PM/PO accountable`, `technical lead`, `implementing engineer`, `QA/validator`, `sponsor`, `consulted`, `informed`, `channel`, `planning agent`, `execution agent`, `validation agent`, `allowed autonomy`, `human reviewer` and `RACI`. Separate an agent's contribution from the person who approves; document the actions taken and the evidence, without attributing decisions to an agent by default.
|
|
69
|
+
|
|
70
|
+
## 4. Roadmap item template
|
|
71
|
+
|
|
72
|
+
Copy [the template](../roadmap/_modelo-item.md) for each item. The frontmatter holds the seven dimensions of section 3.6 with the standard's exact values, and the checker enforces coherence between them:
|
|
73
|
+
|
|
74
|
+
| Coherence rule | Why |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| `ciclo: Concluído` requires `codigo: Mesclado` and `testes: Aprovados` | done without code on the base branch is a promise |
|
|
77
|
+
| `deploy: Produção` requires `codigo: Mesclado` | you do not deploy what has not been merged |
|
|
78
|
+
| `codigo: Mesclado` requires `evidencias.codigo.commit` **on the base branch** | a merge is proven by git, not by declaration |
|
|
79
|
+
| `ciclo: Bloqueado` requires the `bloqueio` map (reason, dependency, owner, next review) | a blocker without an owner does not get cleared |
|
|
80
|
+
|
|
81
|
+
## 5. Cadence and consistency
|
|
82
|
+
|
|
83
|
+
Revisit active items at the team's cadence and always after a decision, relevant PR, test, deploy, flag change or outcome measurement. At each review, compare roadmap, feature documentation, code, contracts and production evidence; note divergences with an owner and a deadline. Agents can suggest status updates from repository events, but a merged PR updates only the **code** dimension until deploy and exposure are proven. Record the update date and keep a history of decisions and scope changes.
|
|
84
|
+
|
|
85
|
+
In Orkastery, `ork docs sincronizar` is that agent: it updates `estado.codigo` and `evidencias.codigo.commit` from the ledger (`ship_done`) and git, and the `sdlc` section from the thread. **It never touches lifecycle, documentation, deploy, exposure or enablement**: those dimensions are a person's decision, and the checker only requires them to be coherent with the code. In a thread's worktree, it only touches that thread's item and the indexes, so that one thread's PR does not change another thread's item; `--so RM-NNN` picks the items, and `--todos` (the default at the project root, where the conductor syncs after the merge) goes back to all of them.
|
|
86
|
+
|
|
87
|
+
## 6. Three readers and SDLC facts (Orkastery adaptation)
|
|
88
|
+
|
|
89
|
+
The reading rules of the [documentation standard](documentacao-de-produto.md#6-three-readers-and-sdlc-facts-orkastery-adaptation) apply here: answer first, state at a glance, one idea per line, sections with fixed names, frontmatter for agents.
|
|
90
|
+
|
|
91
|
+
What changes in the roadmap is the `sdlc` block, which ties the item to the Orkastery method **with product facts only**:
|
|
92
|
+
|
|
93
|
+
| Key | Content | Who fills it in |
|
|
94
|
+
| --- | --- | --- |
|
|
95
|
+
| `sdlc.thread` | ID of the thread that delivers the item | a person, when opening the thread |
|
|
96
|
+
| `sdlc.modo` | `#Classic`, `#Maestro` or `#Auto` | a person |
|
|
97
|
+
| `sdlc.fase`, `sdlc.status` | current phase and status of the thread | `ork docs sincronizar` |
|
|
98
|
+
| `sdlc.check` | latest verdict of the independent CHECK | a person, based on the assessment |
|
|
99
|
+
|
|
100
|
+
Conduction micro-decisions (re-registered claims, a GO-FIX for a test, a session that dropped) **stay out of the item**: they live in the thread's ledger, which is the method's audit record.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Product documentation
|
|
2
|
+
|
|
3
|
+
> **In one sentence:** what the product is and does today, one page per entity, checked against the code on every PR.
|
|
4
|
+
|
|
5
|
+
- **Standard:** [product documentation](../padroes/documentacao-de-produto.md) · **Companion:** [roadmap](../roadmap/README.md)
|
|
6
|
+
- **Hierarchy:** platform (`PLAT`) → system (`SYS`) → module (`MOD`) → feature (`FEAT`)
|
|
7
|
+
- **New page:** copy [the template](_modelo-feature.md) and run `ork docs verificar`
|
|
8
|
+
|
|
9
|
+
## Index
|
|
10
|
+
|
|
11
|
+
Generated by `ork docs sincronizar` from the frontmatter of each page, with the column labels in Portuguese.
|
|
12
|
+
|
|
13
|
+
<!-- ork-docs:indice:inicio -->
|
|
14
|
+
<!-- ork-docs:indice:fim -->
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: FEAT-000
|
|
3
|
+
tipo: feature
|
|
4
|
+
titulo: <Feature name>
|
|
5
|
+
estado: proposto
|
|
6
|
+
pai: MOD-00
|
|
7
|
+
roadmap: [RM-000]
|
|
8
|
+
owner: <name>
|
|
9
|
+
aprovador: <name>
|
|
10
|
+
verificado_em: 2026-01-01T00:00:00-03:00
|
|
11
|
+
versao: main@0000000
|
|
12
|
+
fontes:
|
|
13
|
+
codigo: []
|
|
14
|
+
testes: []
|
|
15
|
+
simbolos: []
|
|
16
|
+
contratos: []
|
|
17
|
+
comandos: []
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<!-- The feature number comes from `ork roadmap feat --thread <thread>`, reserved across machines; never from the highest number on your branch. -->
|
|
21
|
+
<!-- Keep the frontmatter keys and values, the section titles and the "Em uma frase" line as they are: `ork docs verificar` reads them in Portuguese in every language. -->
|
|
22
|
+
|
|
23
|
+
# FEAT-000: Feature name
|
|
24
|
+
|
|
25
|
+
> **Em uma frase:** [what this feature does, for whom, in up to 240 characters]
|
|
26
|
+
|
|
27
|
+
- **State:** `proposto` · **Verified on:** [YYYY-MM-DD] · **Version:** [branch@commit]
|
|
28
|
+
- **Where it lives:** [PLAT-00 > SYS-00 > MOD-00, with links]
|
|
29
|
+
- **Roadmap:** [RM-000, with a link]
|
|
30
|
+
- **Page owner / approver:** [names]
|
|
31
|
+
|
|
32
|
+
## Comportamento
|
|
33
|
+
|
|
34
|
+
- **Use cases and operations:** [UC-ID, action, actor]
|
|
35
|
+
- **Preconditions and trigger:** [what must exist and what starts it]
|
|
36
|
+
- **Main flow:**
|
|
37
|
+
1. [observable step]
|
|
38
|
+
- **Alternatives, errors and recovery:** [error, cancellation, timeout, resume]
|
|
39
|
+
- **Postconditions:** [what is recorded, emitted or changed outside]
|
|
40
|
+
- **Business rules:** [BR-ID: condition → result; exception]
|
|
41
|
+
- **Acceptance criteria and tests:** [Given/When/Then, with the test that proves it]
|
|
42
|
+
- **Interface and accessibility:** [screens, states, prototype, or Not applicable: reason]
|
|
43
|
+
|
|
44
|
+
## Dados e contratos
|
|
45
|
+
|
|
46
|
+
- **Entities and fields:** [links, types, validations, sensitivity]
|
|
47
|
+
- **APIs and endpoints:** [IDs, methods, contracts, errors, versioning]
|
|
48
|
+
- **Events and jobs:** [IDs, schemas, triggers, retries, time zone]
|
|
49
|
+
|
|
50
|
+
## Operação e controle
|
|
51
|
+
|
|
52
|
+
- **Configuration and environments:** [parameters, no secrets]
|
|
53
|
+
- **Observability:** [metrics, SLO, logs, alerts, runbook]
|
|
54
|
+
- **Access, privacy and compliance:** [applicable controls]
|
|
55
|
+
- **Dependencies and rollback:** [what it uses and how to roll it back]
|
|
56
|
+
- **Code, PR, tests and release:** [identifiable links]
|
|
57
|
+
|
|
58
|
+
## Histórico
|
|
59
|
+
|
|
60
|
+
| Date | Change | Author/reviewer | Evidence or decision |
|
|
61
|
+
| --- | --- | --- | --- |
|
|
62
|
+
| [YYYY-MM-DD] | [description] | [names] | [link] |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Roadmap
|
|
2
|
+
|
|
3
|
+
> **In one sentence:** why change, what to deliver and where each item stands, with the state proven by git, not declared.
|
|
4
|
+
|
|
5
|
+
- **Standard:** [product roadmap](../padroes/roadmap-de-produto.md) · **Companion:** [product documentation](../produto/README.md)
|
|
6
|
+
- **One file per item:** `RM-000-subject.md`, with the state in the frontmatter
|
|
7
|
+
- **New item:** copy [the template](_modelo-item.md) and run `ork docs verificar`
|
|
8
|
+
|
|
9
|
+
## Items
|
|
10
|
+
|
|
11
|
+
Generated by `ork docs sincronizar` from the frontmatter of each item, with the column labels in Portuguese.
|
|
12
|
+
|
|
13
|
+
<!-- ork-docs:indice:inicio -->
|
|
14
|
+
<!-- ork-docs:indice:fim -->
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: RM-000
|
|
3
|
+
tipo: roadmap
|
|
4
|
+
titulo: <Intended result>
|
|
5
|
+
categoria: iniciativa
|
|
6
|
+
pai: null
|
|
7
|
+
features: []
|
|
8
|
+
owner: <name>
|
|
9
|
+
atualizado_em: 2026-01-01T00:00:00-03:00
|
|
10
|
+
estado:
|
|
11
|
+
ciclo: Discovery
|
|
12
|
+
documentacao: Rascunho
|
|
13
|
+
codigo: Não iniciado
|
|
14
|
+
testes: Não iniciados
|
|
15
|
+
deploy: Não implantado
|
|
16
|
+
exposicao: Flag desligada
|
|
17
|
+
habilitacao: Pendente
|
|
18
|
+
evidencias:
|
|
19
|
+
codigo:
|
|
20
|
+
commit: null
|
|
21
|
+
pr: null
|
|
22
|
+
sdlc:
|
|
23
|
+
thread: null
|
|
24
|
+
modo: null
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<!-- Keep the frontmatter keys and values, the section titles and the "Em uma frase" line as they are: `ork docs verificar` reads them in Portuguese in every language. -->
|
|
28
|
+
|
|
29
|
+
# RM-000: Intended result
|
|
30
|
+
|
|
31
|
+
> **Em uma frase:** [what this item delivers, for whom, in up to 240 characters]
|
|
32
|
+
|
|
33
|
+
<!-- ork-docs:relance:inicio -->
|
|
34
|
+
<!-- ork-docs:relance:fim -->
|
|
35
|
+
|
|
36
|
+
## Problema e resultado
|
|
37
|
+
|
|
38
|
+
- **Audience and problem/opportunity:** [who suffers what]
|
|
39
|
+
- **Evidence and source:** [data, conversation, incident, with a link]
|
|
40
|
+
- **Objective/OKR:** [what changes for whom]
|
|
41
|
+
- **Hypothesis:** If [change], then [measurable effect], because [mechanism].
|
|
42
|
+
- **Main metric / baseline / target / window / source:** [values and origin]
|
|
43
|
+
- **Guardrail metrics:** [what must not get worse]
|
|
44
|
+
|
|
45
|
+
## Escopo e validação
|
|
46
|
+
|
|
47
|
+
- **Included:** [what is in]
|
|
48
|
+
- **Out of scope:** [what is out]
|
|
49
|
+
- **Deliverables and acceptance criteria:** [deliverable → how it is proven]
|
|
50
|
+
- **Pilot, measurement and expand/stop criteria:** [how and when to decide]
|
|
51
|
+
|
|
52
|
+
## Plano e decisões
|
|
53
|
+
|
|
54
|
+
- **Priority / method / score / rationale / date:** [values]
|
|
55
|
+
- **Horizon / target / forecast / confidence / milestones:** [values]
|
|
56
|
+
- **Dependencies and blockers (ID, owner, next review):** [list]
|
|
57
|
+
- **Assumptions / risks / mitigation:** [list]
|
|
58
|
+
- **Decisions, alternatives and ADRs (ID, decider, date, link):** [list]
|
|
59
|
+
|
|
60
|
+
## Estado com evidências
|
|
61
|
+
|
|
62
|
+
The state is edited in the frontmatter; this table is generated by `ork docs sincronizar`, with its labels in Portuguese.
|
|
63
|
+
|
|
64
|
+
<!-- ork-docs:estado:inicio -->
|
|
65
|
+
<!-- ork-docs:estado:fim -->
|
|
66
|
+
|
|
67
|
+
## Responsabilidades e histórico
|
|
68
|
+
|
|
69
|
+
- **RACI (R / A / C / I):** [names]
|
|
70
|
+
- **Agents involved, role, autonomy and human reviewer:** [who did what, and who approved]
|
|
71
|
+
- **Next action, owner and deadline:** [one line]
|
|
72
|
+
|
|
73
|
+
| Date | Change of plan, scope or status | Reason and evidence | Decider |
|
|
74
|
+
| --- | --- | --- | --- |
|
|
75
|
+
| [YYYY-MM-DD] | [description] | [link] | [name] |
|
package/assets/orkmind_bridge.py
CHANGED
|
@@ -10,6 +10,7 @@ import math
|
|
|
10
10
|
import os
|
|
11
11
|
import re
|
|
12
12
|
import sys
|
|
13
|
+
from datetime import datetime, timezone
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class LegacyProvenanceCollision(ValueError):
|
|
@@ -370,6 +371,102 @@ async def health(store):
|
|
|
370
371
|
ORK_COLLECTIONS = ('decision', 'handoff', 'rule', 'learning', 'roadmap')
|
|
371
372
|
|
|
372
373
|
|
|
374
|
+
def no_universo(entry, tenant, agora=None):
|
|
375
|
+
"""RM-038: o predicado unico do universo da busca (indice, vetor, FTS e status).
|
|
376
|
+
|
|
377
|
+
O search_by_tags governado ja tira expiradas e injection_risk; o search_by_text nao tira
|
|
378
|
+
injection_risk. O mesmo predicado vale nos dois caminhos, com o tenant conferido como item
|
|
379
|
+
de lista: texto nunca casa por substring. `agora` e o instante de ANTES da leitura: o que a
|
|
380
|
+
biblioteca devolveu como ativo continua ativo aqui, sem corrida de expiracao.
|
|
381
|
+
"""
|
|
382
|
+
tags = getattr(entry, 'tags', None)
|
|
383
|
+
projeto = tags.get('project') if isinstance(tags, dict) else None
|
|
384
|
+
expira = getattr(entry, 'expires_at', None)
|
|
385
|
+
if expira is not None and expira.tzinfo is None:
|
|
386
|
+
expira = expira.replace(tzinfo=timezone.utc)
|
|
387
|
+
return (getattr(entry, 'collection', None) in ORK_COLLECTIONS
|
|
388
|
+
and isinstance(projeto, list) and tenant in projeto
|
|
389
|
+
and not getattr(entry, 'injection_risk', False)
|
|
390
|
+
and (expira is None or expira > (agora or datetime.now(timezone.utc))))
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
async def ate_o_fim(contar, ler):
|
|
394
|
+
"""RM-038: le com a janela da contagem mais um; janela cheia conta e le de novo uma vez.
|
|
395
|
+
|
|
396
|
+
Cheia so acontece com escrita concorrente entre a contagem e a leitura. Uma escrita isolada
|
|
397
|
+
se resolve na segunda leitura; cheia de novo, a resposta e falhar alto, nunca cortar.
|
|
398
|
+
"""
|
|
399
|
+
for _ in range(2):
|
|
400
|
+
limite = await contar() + 1
|
|
401
|
+
lidas = await ler(limite)
|
|
402
|
+
if len(lidas) < limite:
|
|
403
|
+
return lidas
|
|
404
|
+
raise QueryError('memory.query.window-saturated')
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
def universo_contract(request):
|
|
408
|
+
valid = isinstance(request, dict) and set(request) == {'op', 'tenant'}
|
|
409
|
+
tenant = request.get('tenant') if valid else None
|
|
410
|
+
if (not valid or request['op'] != 'universo' or not isinstance(tenant, str) or not tenant.strip()
|
|
411
|
+
or len(tenant) > 128 or re.search(r'[\x00-\x1f\x7f]', tenant) is not None):
|
|
412
|
+
raise QueryError('memory.universo.invalid')
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
# Contagem SO de numeros: nenhuma coluna de conteudo sai da base por aqui. O tenant e o mesmo
|
|
416
|
+
# predicado da leitura governada por tag (`tags @> {"project": [tenant]}`), que usa o indice de tags.
|
|
417
|
+
FORA_DA_BUSCA_SQL = """
|
|
418
|
+
SELECT
|
|
419
|
+
count(*) FILTER (WHERE collection = ANY(%s) AND injection_risk
|
|
420
|
+
AND (expires_at IS NULL OR expires_at > now())) AS injecao,
|
|
421
|
+
count(*) FILTER (WHERE collection = ANY(%s) AND expires_at IS NOT NULL AND expires_at <= now()) AS expiradas,
|
|
422
|
+
count(*) FILTER (WHERE NOT (collection = ANY(%s))) AS outras_colecoes
|
|
423
|
+
FROM memories
|
|
424
|
+
WHERE tags @> jsonb_build_object('project', jsonb_build_array(%s::text))
|
|
425
|
+
"""
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
async def contar_fora_da_busca(store, tenant):
|
|
429
|
+
"""RM-038: quantas entradas do tenant ficam fora do universo e por que.
|
|
430
|
+
|
|
431
|
+
A API governada nao devolve o que filtra; a contagem le a tabela pela conexao do adapter
|
|
432
|
+
pgvector (o mesmo acesso do lock de add e handoff), so com count(*). Em outro backend a
|
|
433
|
+
contagem nao e medida e volta None.
|
|
434
|
+
"""
|
|
435
|
+
if getattr(getattr(store, 'capabilities', None), 'backend', None) != 'pgvector':
|
|
436
|
+
return None
|
|
437
|
+
conn = await store.inner._get_conn()
|
|
438
|
+
colecoes = list(ORK_COLLECTIONS)
|
|
439
|
+
cur = await conn.execute(FORA_DA_BUSCA_SQL, (colecoes, colecoes, colecoes, tenant))
|
|
440
|
+
linha = await cur.fetchone()
|
|
441
|
+
return {'injecao': int(linha['injecao']), 'expiradas': int(linha['expiradas']),
|
|
442
|
+
'outrasColecoes': int(linha['outras_colecoes'])}
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
async def universo(request, store):
|
|
446
|
+
"""RM-038: o universo da busca do tenant, lido ate o fim, uma leitura governada por colecao.
|
|
447
|
+
|
|
448
|
+
O tenant e filtro na origem: texto de outro tenant nunca sai da base por aqui. A janela e a
|
|
449
|
+
colecao inteira mais um (ate_o_fim). Entrada fora do predicado e violacao. O vetor gravado na
|
|
450
|
+
base nao viaja: o ork nao o usa.
|
|
451
|
+
"""
|
|
452
|
+
tenant = request['tenant']
|
|
453
|
+
agora = datetime.now(timezone.utc)
|
|
454
|
+
entradas = []
|
|
455
|
+
for colecao in ORK_COLLECTIONS:
|
|
456
|
+
async def contar(colecao=colecao):
|
|
457
|
+
return await store.count(colecao)
|
|
458
|
+
async def ler(limite, colecao=colecao):
|
|
459
|
+
return await store.search_by_tags({'project': [tenant]}, collection=colecao, limit=limite)
|
|
460
|
+
lidas = await ate_o_fim(contar, ler)
|
|
461
|
+
if any(e.collection != colecao or not no_universo(e, tenant, agora) for e in lidas):
|
|
462
|
+
raise QueryError('memory.query.scope-violation')
|
|
463
|
+
entradas.extend(lidas)
|
|
464
|
+
if len({e.id for e in entradas}) != len(entradas):
|
|
465
|
+
raise QueryError('memory.query.scope-violation')
|
|
466
|
+
return {'entradas': [e.model_dump(mode='json', exclude={'embedding'}) for e in entradas],
|
|
467
|
+
'foraDaBusca': await contar_fora_da_busca(store, tenant)}
|
|
468
|
+
|
|
469
|
+
|
|
373
470
|
def fts_contract(request):
|
|
374
471
|
valid = isinstance(request, dict) and set(request) == {'op', 'tenant', 'texto'}
|
|
375
472
|
def text(value, maximum):
|
|
@@ -379,14 +476,16 @@ def fts_contract(request):
|
|
|
379
476
|
|
|
380
477
|
|
|
381
478
|
async def fts(request, store):
|
|
382
|
-
"""FTS da biblioteca (I-38 D9)
|
|
479
|
+
"""FTS da biblioteca (I-38 D9) restrito ao universo da busca (RM-038): so ids, na ordem do ranking."""
|
|
383
480
|
# A janela cobre a base inteira: ausencia so conta quando nada ficou de fora do corte.
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
481
|
+
agora = datetime.now(timezone.utc)
|
|
482
|
+
async def contar():
|
|
483
|
+
return await store.count()
|
|
484
|
+
async def ler(limite):
|
|
485
|
+
return await store.search_by_text(request['texto'], limit=limite)
|
|
486
|
+
entries = await ate_o_fim(contar, ler)
|
|
487
|
+
# O search_by_text alcanca injection_risk; o universo nao. Mesmo predicado do indice.
|
|
488
|
+
return {'ids': [e.id for e in entries if no_universo(e, request['tenant'], agora)]}
|
|
390
489
|
|
|
391
490
|
|
|
392
491
|
async def execute(request, store):
|
|
@@ -403,6 +502,9 @@ async def execute(request, store):
|
|
|
403
502
|
if op == 'fts':
|
|
404
503
|
fts_contract(request)
|
|
405
504
|
return await fts(request, store)
|
|
505
|
+
if op == 'universo':
|
|
506
|
+
universo_contract(request)
|
|
507
|
+
return await universo(request, store)
|
|
406
508
|
if op == 'query':
|
|
407
509
|
tags, collection, limit = query_contract(request)
|
|
408
510
|
# GovernedStore conserva validade, anti-injection e visibilidade existentes.
|
|
@@ -417,8 +519,12 @@ async def execute(request, store):
|
|
|
417
519
|
return [e.model_dump(mode='json') for e in entries]
|
|
418
520
|
if op == 'export':
|
|
419
521
|
collection = request['collection']
|
|
420
|
-
|
|
421
|
-
|
|
522
|
+
async def contar():
|
|
523
|
+
return await store.count(collection)
|
|
524
|
+
async def ler(limite):
|
|
525
|
+
return await store.search_by_tags({}, collection=collection, limit=limite)
|
|
526
|
+
# RM-038: le ate o fim; janela cheia de novo e falha alta, nunca corte em silencio.
|
|
527
|
+
entries = await ate_o_fim(contar, ler)
|
|
422
528
|
return [e.model_dump(mode='json') for e in entries]
|
|
423
529
|
if op == 'get':
|
|
424
530
|
entry = await store.retrieve(request['id'])
|
|
@@ -538,6 +644,8 @@ async def main(request):
|
|
|
538
644
|
health_contract(request)
|
|
539
645
|
if isinstance(request, dict) and request.get('op') == 'fts':
|
|
540
646
|
fts_contract(request)
|
|
647
|
+
if isinstance(request, dict) and request.get('op') == 'universo':
|
|
648
|
+
universo_contract(request)
|
|
541
649
|
native_schema_fields()
|
|
542
650
|
from orkmind.core.config import OrkMindConfig
|
|
543
651
|
from orkmind.store.factory import create_store
|