From 2b10435643caa0003bef6b981693e1c5f16cc4f5 Mon Sep 17 00:00:00 2001 From: Rodolpho Lopes Date: Tue, 26 May 2026 15:11:41 +0000 Subject: [PATCH] =?UTF-8?q?Initial=20commit=20=E2=80=94=20knowledge=20base?= =?UTF-8?q?=20migrada=20do=20dev=20local?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 + README.md | 53 ++ index.json | 389 +++++++++++++++ .../KB-INFRA-001-glpi-plugin-path.md | 66 +++ .../KB-INFRA-002-plugin-icon-logo-png.md | 89 ++++ .../KB-PLUGIN-001-install-hooks-required.md | 57 +++ ...N-002-questiontype-getcategory-override.md | 67 +++ ...003-json-script-tag-no-htmlspecialchars.md | 65 +++ ...4-plugin-hook-key-must-match-plugin-key.md | 67 +++ ...005-last-valid-answer-exact-class-match.md | 96 ++++ ...PLUGIN-006-plugin-rename-full-procedure.md | 107 +++++ ...UGIN-007-questiontypeitemdropdown-final.md | 54 +++ ...-008-questiontype-validation-interfaces.md | 69 +++ ...009-transformconditionvalue-empty-array.md | 65 +++ ...-PLUGIN-010-ajax-csrf-x-glpi-csrf-token.md | 95 ++++ ...GIN-011-mindplace-release-zip-procedure.md | 77 +++ ...N-012-helpdesk-tiles-extension-patterns.md | 276 +++++++++++ ...13-mindplace-plugin-publication-runbook.md | 451 ++++++++++++++++++ ...PLUGIN-014-getfromdbbycrit-stale-fields.md | 124 +++++ ...-PLUGIN-015-querySelector-row-collision.md | 94 ++++ ...GIN-016-glpi11-csrf-bypass-and-api-auth.md | 112 +++++ ...-017-mindplace-zip-wrapper-detector-bug.md | 122 +++++ ...8-plugin-release-zip-wrapper-convention.md | 141 ++++++ ...-PLUGIN-019-mcprotocol-bff-architecture.md | 23 + .../KB-PLUGIN-020-mcprotocol-bff-roadmap.md | 33 ++ schemas/knowledge-record.schema.json | 68 +++ 26 files changed, 2864 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 index.json create mode 100644 records/infrastructure/KB-INFRA-001-glpi-plugin-path.md create mode 100644 records/infrastructure/KB-INFRA-002-plugin-icon-logo-png.md create mode 100644 records/plugin-dev/KB-PLUGIN-001-install-hooks-required.md create mode 100644 records/plugin-dev/KB-PLUGIN-002-questiontype-getcategory-override.md create mode 100644 records/plugin-dev/KB-PLUGIN-003-json-script-tag-no-htmlspecialchars.md create mode 100644 records/plugin-dev/KB-PLUGIN-004-plugin-hook-key-must-match-plugin-key.md create mode 100644 records/plugin-dev/KB-PLUGIN-005-last-valid-answer-exact-class-match.md create mode 100644 records/plugin-dev/KB-PLUGIN-006-plugin-rename-full-procedure.md create mode 100644 records/plugin-dev/KB-PLUGIN-007-questiontypeitemdropdown-final.md create mode 100644 records/plugin-dev/KB-PLUGIN-008-questiontype-validation-interfaces.md create mode 100644 records/plugin-dev/KB-PLUGIN-009-transformconditionvalue-empty-array.md create mode 100644 records/plugin-dev/KB-PLUGIN-010-ajax-csrf-x-glpi-csrf-token.md create mode 100644 records/plugin-dev/KB-PLUGIN-011-mindplace-release-zip-procedure.md create mode 100644 records/plugin-dev/KB-PLUGIN-012-helpdesk-tiles-extension-patterns.md create mode 100644 records/plugin-dev/KB-PLUGIN-013-mindplace-plugin-publication-runbook.md create mode 100644 records/plugin-dev/KB-PLUGIN-014-getfromdbbycrit-stale-fields.md create mode 100644 records/plugin-dev/KB-PLUGIN-015-querySelector-row-collision.md create mode 100644 records/plugin-dev/KB-PLUGIN-016-glpi11-csrf-bypass-and-api-auth.md create mode 100644 records/plugin-dev/KB-PLUGIN-017-mindplace-zip-wrapper-detector-bug.md create mode 100644 records/plugin-dev/KB-PLUGIN-018-plugin-release-zip-wrapper-convention.md create mode 100644 records/plugin-dev/KB-PLUGIN-019-mcprotocol-bff-architecture.md create mode 100644 records/plugin-dev/KB-PLUGIN-020-mcprotocol-bff-roadmap.md create mode 100644 schemas/knowledge-record.schema.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b8e4304 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +*.swp +*.tmp +*.bak diff --git a/README.md b/README.md new file mode 100644 index 0000000..71fdd42 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# Base de Conhecimento para Agentes de IA + +Esta base foi projetada para leitura eficiente por agentes e humanos. + +## Arquitetura recomendada +- `index.json`: catalogo central para busca semantica rapida por agente. +- `records/`: um registro por arquivo Markdown, com metadados em front matter YAML. +- `schemas/`: contrato JSON Schema para validar metadados e manter consistencia. + +## Por que esse formato e eficiente +- **JSON para roteamento**: agentes localizam o registro certo sem ler toda a base. +- **Markdown para contexto**: explica causa, impacto e procedimento com baixa ambiguidade. +- **Metadados padronizados**: permite filtro por `tags`, `severity`, `domain` e `status`. +- **Versionamento simples**: cada incidente vira um arquivo independente e auditavel no Git. + +## Convencao de registros +- ID: `KB--NNN` (ex.: `KB-INFRA-001`) +- Nome de arquivo: `-.md` +- Campos obrigatorios de metadados: + - `id` + - `title` + - `domain` + - `tags` + - `status` + - `severity` + - `created_at` + - `updated_at` + - `applies_to` + +## Fluxo de atualizacao +1. Criar novo registro em `records//`. +2. Atualizar `index.json` com resumo e caminho. +3. Validar aderencia ao schema em `schemas/`. +4. Referenciar o registro em documentacao operacional quando necessario. + +## Validacao automatica +Use: + +```bash +make kb-check +make kb-fix +``` + +A verificacao valida: +- metadados obrigatorios conforme schema; +- padrao de ID de registro; +- sincronizacao entre `index.json` e arquivos em `records/`. + +`make kb-fix` faz ajustes automaticos no `index.json`: +- inclui registros faltantes; +- remove entradas orfas; +- sincroniza campos principais; +- atualiza `last_updated`. diff --git a/index.json b/index.json new file mode 100644 index 0000000..fe69ec3 --- /dev/null +++ b/index.json @@ -0,0 +1,389 @@ +{ + "version": "1.0.0", + "last_updated": "2026-05-21", + "records": [ + { + "id": "KB-INFRA-001", + "title": "Caminho correto de plugins no container GLPI oficial", + "domain": "infrastructure", + "tags": [ + "glpi", + "docker", + "plugins", + "mount", + "orbstack" + ], + "status": "active", + "severity": "high", + "path": "records/infrastructure/KB-INFRA-001-glpi-plugin-path.md", + "summary": "id: KB-INFRA-001" + }, + { + "id": "KB-INFRA-002", + "title": "Icone de plugin GLPI 11 requer logo.png PNG na raiz do diretorio", + "domain": "infrastructure", + "tags": [ + "glpi", + "glpi11", + "plugin", + "icon", + "logo", + "marketplace" + ], + "status": "active", + "severity": "low", + "path": "records/infrastructure/KB-INFRA-002-plugin-icon-logo-png.md", + "summary": "id: KB-INFRA-002" + }, + { + "id": "KB-PLUGIN-001", + "title": "Instalacao de plugin GLPI requer callbacks install/uninstall", + "domain": "plugin-dev", + "tags": [ + "glpi", + "plugin", + "install", + "setup.php", + "hooks" + ], + "status": "active", + "severity": "high", + "path": "records/plugin-dev/KB-PLUGIN-001-install-hooks-required.md", + "summary": "id: KB-PLUGIN-001" + }, + { + "id": "KB-PLUGIN-002", + "title": "getCategory() deve ser sobrescrito em QuestionType de plugin GLPI 11", + "domain": "plugin-dev", + "tags": [ + "glpi", + "glpi11", + "form-builder", + "question-type", + "javascript", + "plugin" + ], + "status": "active", + "severity": "critical", + "path": "records/plugin-dev/KB-PLUGIN-002-questiontype-getcategory-override.md", + "summary": "id: KB-PLUGIN-002" + }, + { + "id": "KB-PLUGIN-003", + "title": "JSON em acidental +$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP); +``` + +# Por que JSON_HEX_TAG e JSON_HEX_AMP +- `JSON_HEX_TAG`: converte `<` → `<` e `>` → `>`, impedindo que `` apareça + literalmente e quebre o bloco script. Isso SIM é necessário para segurança. +- `JSON_HEX_AMP`: converte `&` → `&`, evita problemas em contextos XML/XHTML. +- `htmlspecialchars()` não deve ser usado — ele gera entidades HTML, não sequências JSON. + +# Validação padrão +1. Inspecionar o DOM e copiar o conteúdo do `