moai-adk 0.8.1__py3-none-any.whl → 0.8.3__py3-none-any.whl
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.
Potentially problematic release.
This version of moai-adk might be problematic. Click here for more details.
- moai_adk/cli/commands/update.py +15 -4
- moai_adk/core/config/migration.py +1 -1
- moai_adk/core/issue_creator.py +7 -3
- moai_adk/core/tags/__init__.py +86 -0
- moai_adk/core/tags/ci_validator.py +433 -0
- moai_adk/core/tags/cli.py +283 -0
- moai_adk/core/tags/generator.py +109 -0
- moai_adk/core/tags/inserter.py +99 -0
- moai_adk/core/tags/mapper.py +126 -0
- moai_adk/core/tags/parser.py +76 -0
- moai_adk/core/tags/pre_commit_validator.py +355 -0
- moai_adk/core/tags/reporter.py +957 -0
- moai_adk/core/tags/tags.py +149 -0
- moai_adk/core/tags/validator.py +897 -0
- moai_adk/templates/.claude/agents/alfred/cc-manager.md +25 -2
- moai_adk/templates/.claude/agents/alfred/debug-helper.md +24 -12
- moai_adk/templates/.claude/agents/alfred/doc-syncer.md +19 -12
- moai_adk/templates/.claude/agents/alfred/git-manager.md +20 -12
- moai_adk/templates/.claude/agents/alfred/implementation-planner.md +19 -12
- moai_adk/templates/.claude/agents/alfred/project-manager.md +29 -2
- moai_adk/templates/.claude/agents/alfred/quality-gate.md +25 -2
- moai_adk/templates/.claude/agents/alfred/skill-factory.md +30 -2
- moai_adk/templates/.claude/agents/alfred/spec-builder.md +26 -11
- moai_adk/templates/.claude/agents/alfred/tag-agent.md +30 -8
- moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +27 -12
- moai_adk/templates/.claude/agents/alfred/trust-checker.md +25 -2
- moai_adk/templates/.claude/commands/alfred/0-project.md +5 -0
- moai_adk/templates/.claude/commands/alfred/1-plan.md +82 -19
- moai_adk/templates/.claude/commands/alfred/2-run.md +72 -15
- moai_adk/templates/.claude/commands/alfred/3-sync.md +74 -14
- moai_adk/templates/.claude/hooks/alfred/.moai/cache/version-check.json +9 -0
- moai_adk/templates/.claude/hooks/alfred/README.md +258 -145
- moai_adk/templates/.claude/hooks/alfred/TROUBLESHOOTING.md +471 -0
- moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +92 -57
- moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +198 -0
- moai_adk/templates/.claude/hooks/alfred/notification__handle_events.py +102 -0
- moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +102 -0
- moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +108 -0
- moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +102 -0
- moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +102 -0
- moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/project.py +286 -19
- moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +198 -0
- moai_adk/templates/.claude/hooks/alfred/{handlers → shared/handlers}/session.py +21 -7
- moai_adk/templates/.claude/hooks/alfred/stop__handle_interrupt.py +102 -0
- moai_adk/templates/.claude/hooks/alfred/subagent_stop__handle_subagent_end.py +102 -0
- moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +120 -0
- moai_adk/templates/.claude/settings.json +5 -5
- moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +9 -6
- moai_adk/templates/.claude/skills/moai-spec-authoring/README.md +56 -56
- moai_adk/templates/.claude/skills/moai-spec-authoring/SKILL.md +101 -100
- moai_adk/templates/.claude/skills/moai-spec-authoring/examples/validate-spec.sh +3 -3
- moai_adk/templates/.claude/skills/moai-spec-authoring/examples.md +219 -219
- moai_adk/templates/.claude/skills/moai-spec-authoring/reference.md +287 -287
- moai_adk/templates/.github/ISSUE_TEMPLATE/spec.yml +9 -11
- moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +9 -21
- moai_adk/templates/.github/workflows/moai-release-create.yml +100 -0
- moai_adk/templates/.github/workflows/moai-release-pipeline.yml +182 -0
- moai_adk/templates/.github/workflows/release.yml +49 -0
- moai_adk/templates/.github/workflows/tag-report.yml +261 -0
- moai_adk/templates/.github/workflows/tag-validation.yml +176 -0
- moai_adk/templates/.moai/config.json +6 -1
- moai_adk/templates/.moai/hooks/install.sh +79 -0
- moai_adk/templates/.moai/hooks/pre-commit.sh +66 -0
- moai_adk/templates/CLAUDE.md +39 -40
- moai_adk/templates/src/moai_adk/core/__init__.py +5 -0
- moai_adk/templates/src/moai_adk/core/tags/__init__.py +86 -0
- moai_adk/templates/src/moai_adk/core/tags/ci_validator.py +433 -0
- moai_adk/templates/src/moai_adk/core/tags/cli.py +283 -0
- moai_adk/templates/src/moai_adk/core/tags/pre_commit_validator.py +355 -0
- moai_adk/templates/src/moai_adk/core/tags/reporter.py +957 -0
- moai_adk/templates/src/moai_adk/core/tags/validator.py +897 -0
- {moai_adk-0.8.1.dist-info → moai_adk-0.8.3.dist-info}/METADATA +240 -14
- {moai_adk-0.8.1.dist-info → moai_adk-0.8.3.dist-info}/RECORD +85 -50
- moai_adk/templates/.claude/hooks/alfred/HOOK_SCHEMA_VALIDATION.md +0 -313
- moai_adk/templates/.moai/memory/config-schema.md +0 -444
- /moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/__init__.py +0 -0
- /moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/checkpoint.py +0 -0
- /moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/context.py +0 -0
- /moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/tags.py +0 -0
- /moai_adk/templates/.claude/hooks/alfred/{handlers → shared/handlers}/__init__.py +0 -0
- /moai_adk/templates/.claude/hooks/alfred/{handlers → shared/handlers}/notification.py +0 -0
- /moai_adk/templates/.claude/hooks/alfred/{handlers → shared/handlers}/tool.py +0 -0
- /moai_adk/templates/.claude/hooks/alfred/{handlers → shared/handlers}/user.py +0 -0
- /moai_adk/templates/.moai/memory/{issue-label-mapping.md → ISSUE-LABEL-MAPPING.md} +0 -0
- {moai_adk-0.8.1.dist-info → moai_adk-0.8.3.dist-info}/WHEEL +0 -0
- {moai_adk-0.8.1.dist-info → moai_adk-0.8.3.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.8.1.dist-info → moai_adk-0.8.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# @CODE:VAL-001
|
|
2
|
+
"""TAG suggestion and validation orchestrator.
|
|
3
|
+
|
|
4
|
+
Combines parser, generator, mapper, and inserter modules to provide
|
|
5
|
+
high-level TAG suggestion functionality for documentation files.
|
|
6
|
+
|
|
7
|
+
@SPEC:DOC-TAG-001: @DOC tag automatic generation infrastructure
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from dataclasses import dataclass
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from typing import Optional
|
|
13
|
+
|
|
14
|
+
from moai_adk.core.tags.generator import detect_duplicates, generate_doc_tag
|
|
15
|
+
from moai_adk.core.tags.mapper import calculate_confidence, find_related_spec
|
|
16
|
+
from moai_adk.core.tags.parser import parse_domain
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@dataclass
|
|
20
|
+
class TagSuggestion:
|
|
21
|
+
"""Suggested TAG for a documentation file.
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
tag_id: Generated TAG ID (e.g., "@DOC:AUTH-001")
|
|
25
|
+
chain_ref: Chain reference to SPEC (e.g., "@SPEC:AUTH-001")
|
|
26
|
+
confidence: Confidence score (0.0 to 1.0)
|
|
27
|
+
domain: Extracted domain (e.g., "AUTH")
|
|
28
|
+
file_path: Path to documentation file
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
tag_id: str
|
|
32
|
+
chain_ref: Optional[str]
|
|
33
|
+
confidence: float
|
|
34
|
+
domain: str
|
|
35
|
+
file_path: Path
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def suggest_tag_for_file(
|
|
39
|
+
doc_path: Path, search_path: Path = Path("docs/")
|
|
40
|
+
) -> TagSuggestion:
|
|
41
|
+
"""Suggest TAG ID for documentation file.
|
|
42
|
+
|
|
43
|
+
Combines domain detection, SPEC mapping, and TAG generation to
|
|
44
|
+
provide a complete TAG suggestion with chain reference.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
doc_path: Path to documentation file
|
|
48
|
+
search_path: Directory to search for existing tags
|
|
49
|
+
|
|
50
|
+
Returns:
|
|
51
|
+
TagSuggestion with generated TAG and chain reference
|
|
52
|
+
|
|
53
|
+
Examples:
|
|
54
|
+
>>> suggestion = suggest_tag_for_file(Path("docs/auth/guide.md"))
|
|
55
|
+
>>> suggestion.tag_id
|
|
56
|
+
'@DOC:AUTH-001'
|
|
57
|
+
>>> suggestion.chain_ref
|
|
58
|
+
'@SPEC:AUTH-001'
|
|
59
|
+
>>> suggestion.confidence
|
|
60
|
+
0.85
|
|
61
|
+
"""
|
|
62
|
+
# Find related SPEC
|
|
63
|
+
spec_id = find_related_spec(doc_path)
|
|
64
|
+
|
|
65
|
+
# Extract domain
|
|
66
|
+
if spec_id:
|
|
67
|
+
domain = parse_domain(spec_id)
|
|
68
|
+
chain_ref = f"@SPEC:{spec_id}"
|
|
69
|
+
confidence = calculate_confidence(spec_id, doc_path)
|
|
70
|
+
else:
|
|
71
|
+
# Infer domain from file path if no SPEC found
|
|
72
|
+
domain = _infer_domain_from_path(doc_path)
|
|
73
|
+
chain_ref = None
|
|
74
|
+
confidence = 0.3
|
|
75
|
+
|
|
76
|
+
# Detect existing TAGs in the domain
|
|
77
|
+
existing_ids = detect_duplicates(domain, str(search_path))
|
|
78
|
+
|
|
79
|
+
# Generate next TAG ID
|
|
80
|
+
tag_id = generate_doc_tag(domain, existing_ids)
|
|
81
|
+
|
|
82
|
+
return TagSuggestion(
|
|
83
|
+
tag_id=tag_id,
|
|
84
|
+
chain_ref=chain_ref,
|
|
85
|
+
confidence=confidence,
|
|
86
|
+
domain=domain,
|
|
87
|
+
file_path=doc_path,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _infer_domain_from_path(doc_path: Path) -> str:
|
|
92
|
+
"""Infer domain from file path.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
doc_path: Path to documentation file
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
Inferred domain (uppercase)
|
|
99
|
+
|
|
100
|
+
Examples:
|
|
101
|
+
>>> _infer_domain_from_path(Path("docs/auth/guide.md"))
|
|
102
|
+
'AUTH'
|
|
103
|
+
>>> _infer_domain_from_path(Path("docs/cli-tool/commands.md"))
|
|
104
|
+
'CLI-TOOL'
|
|
105
|
+
"""
|
|
106
|
+
path_parts = doc_path.parts
|
|
107
|
+
if len(path_parts) < 2:
|
|
108
|
+
return "DOC"
|
|
109
|
+
|
|
110
|
+
# Get first directory under 'docs/' as domain
|
|
111
|
+
domain = path_parts[1] if path_parts[0] == "docs" else path_parts[0]
|
|
112
|
+
return domain.upper().replace("_", "-")
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def validate_tag_chain(tag_id: str, chain_ref: str) -> bool:
|
|
116
|
+
"""Validate TAG chain reference consistency.
|
|
117
|
+
|
|
118
|
+
Checks that TAG domain matches SPEC domain in chain reference.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
tag_id: TAG ID (e.g., "@DOC:AUTH-001")
|
|
122
|
+
chain_ref: Chain reference (e.g., "@SPEC:AUTH-001 -> @DOC:AUTH-001")
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
True if chain is valid
|
|
126
|
+
|
|
127
|
+
Examples:
|
|
128
|
+
>>> validate_tag_chain("@DOC:AUTH-001", "@SPEC:AUTH-001 -> @DOC:AUTH-001")
|
|
129
|
+
True
|
|
130
|
+
>>> validate_tag_chain("@DOC:AUTH-001", "@SPEC:API-001 -> @DOC:AUTH-001")
|
|
131
|
+
False
|
|
132
|
+
"""
|
|
133
|
+
# Check if chain contains TAG ID
|
|
134
|
+
if tag_id not in chain_ref:
|
|
135
|
+
return False
|
|
136
|
+
|
|
137
|
+
# Extract TAG domain (e.g., "@DOC:AUTH-001" -> "AUTH")
|
|
138
|
+
tag_domain = tag_id.split(":")[1].rsplit("-", 1)[0]
|
|
139
|
+
|
|
140
|
+
# Extract SPEC part from chain (e.g., "@SPEC:AUTH-001" or "@SPEC:API-001")
|
|
141
|
+
import re
|
|
142
|
+
spec_match = re.search(r"@SPEC:([A-Z0-9-]+)-\d{3}", chain_ref)
|
|
143
|
+
if not spec_match:
|
|
144
|
+
return False
|
|
145
|
+
|
|
146
|
+
spec_domain = spec_match.group(1)
|
|
147
|
+
|
|
148
|
+
# Domains must match
|
|
149
|
+
return spec_domain == tag_domain
|