@geraldmaron/construct 1.0.14 → 1.0.16
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/README.md +21 -2
- package/bin/construct +146 -83
- package/commands/build/feature.md +0 -6
- package/commands/build/fix.md +0 -6
- package/commands/design/access.md +0 -6
- package/commands/design/flow.md +0 -6
- package/commands/design/ui.md +0 -6
- package/commands/measure/experiment.md +0 -6
- package/commands/measure/metrics.md +0 -6
- package/commands/measure/results.md +0 -6
- package/commands/plan/api.md +0 -6
- package/commands/plan/challenge.md +0 -6
- package/commands/plan/decide.md +0 -6
- package/commands/plan/feature.md +0 -7
- package/commands/plan/requirements.md +0 -6
- package/commands/remember/context.md +0 -6
- package/commands/remember/handoff.md +0 -6
- package/commands/remember/runbook.md +0 -6
- package/commands/review/code.md +0 -6
- package/commands/review/quality.md +0 -6
- package/commands/review/security.md +0 -6
- package/commands/ship/ready.md +0 -6
- package/commands/ship/release.md +0 -6
- package/commands/ship/status.md +0 -6
- package/commands/understand/docs.md +0 -6
- package/commands/understand/research.md +0 -6
- package/commands/understand/this.md +0 -6
- package/commands/understand/why.md +0 -6
- package/commands/work/clean.md +0 -6
- package/commands/work/drive.md +0 -6
- package/commands/work/optimize-prompts.md +0 -6
- package/commands/work/parallel-review.md +0 -6
- package/db/schema/010_cx_scores.sql +51 -0
- package/lib/beads-client.mjs +19 -1
- package/lib/cli-commands.mjs +280 -146
- package/lib/comment-lint.mjs +5 -1
- package/lib/context-state.mjs +15 -3
- package/lib/contracts/validate.mjs +72 -18
- package/lib/contracts/violation-log.mjs +169 -0
- package/lib/document-extract/docling-client.mjs +114 -0
- package/lib/document-extract/docling-sidecar.py +122 -0
- package/lib/document-extract/whisper-client.mjs +79 -0
- package/lib/document-extract.mjs +73 -8
- package/lib/document-ingest.mjs +26 -4
- package/lib/embed/daemon.mjs +6 -1
- package/lib/flavors/loader.mjs +1 -1
- package/lib/handoffs/contract.mjs +2 -2
- package/lib/hooks/session-start.mjs +1 -1
- package/lib/hooks/stop-notify.mjs +7 -0
- package/lib/ingest/chunker.mjs +94 -0
- package/lib/ingest/pipeline.mjs +53 -0
- package/lib/ingest/store.mjs +82 -0
- package/lib/install/first-invocation.mjs +5 -1
- package/lib/intake/prepare.mjs +22 -4
- package/lib/integrations/intake-integrations.mjs +28 -2
- package/lib/knowledge/search.mjs +12 -0
- package/lib/mcp/server.mjs +142 -1
- package/lib/mcp/tools/skills.mjs +6 -3
- package/lib/mcp/tools/telemetry.mjs +30 -0
- package/lib/mcp/tools/workflow.mjs +6 -2
- package/lib/observation-store.mjs +14 -5
- package/lib/ollama-manager.mjs +32 -28
- package/lib/orchestration-policy.mjs +15 -0
- package/lib/prompt-composer.js +11 -1
- package/lib/roles/gateway.mjs +30 -1
- package/lib/runtime/uv-bootstrap.mjs +129 -0
- package/lib/runtime/whisper-bootstrap.mjs +102 -0
- package/lib/scheduler/index.mjs +24 -4
- package/lib/server/index.mjs +22 -1
- package/lib/server/insights.mjs +12 -0
- package/lib/server/static/index.html +1 -1
- package/lib/setup.mjs +54 -9
- package/lib/specialists/postconditions.mjs +1 -1
- package/lib/sync/skill-frontmatter.mjs +113 -21
- package/lib/tracking-surfaces.mjs +2 -0
- package/lib/update.mjs +31 -3
- package/lib/upgrade.mjs +31 -4
- package/lib/validators/skills.mjs +86 -54
- package/package.json +5 -5
- package/personas/construct.md +6 -7
- package/platforms/claude/CLAUDE.md +43 -15
- package/platforms/claude/settings.template.json +1 -1
- package/rules/common/beads-hygiene.md +3 -9
- package/rules/common/code-review.md +3 -6
- package/rules/common/coding-style.md +3 -6
- package/rules/common/comments.md +3 -7
- package/rules/common/commit-approval.md +3 -6
- package/rules/common/cx-agent-routing.md +3 -7
- package/rules/common/cx-skill-routing.md +3 -3
- package/rules/common/doc-ownership.md +3 -8
- package/rules/common/efficiency.md +3 -8
- package/rules/common/framing.md +3 -8
- package/rules/common/git-workflow.md +3 -5
- package/rules/common/no-fabrication.md +4 -12
- package/rules/common/patterns.md +3 -5
- package/rules/common/release-gates.md +3 -8
- package/rules/common/research.md +3 -8
- package/rules/common/review-before-change.md +3 -9
- package/rules/common/security.md +3 -6
- package/rules/common/skill-composition.md +3 -7
- package/rules/common/testing.md +3 -6
- package/rules/golang/coding-style.md +1 -5
- package/rules/golang/hooks.md +1 -5
- package/rules/golang/patterns.md +1 -5
- package/rules/golang/security.md +1 -5
- package/rules/golang/testing.md +1 -5
- package/rules/python/coding-style.md +1 -5
- package/rules/python/hooks.md +1 -5
- package/rules/python/patterns.md +1 -5
- package/rules/python/security.md +1 -5
- package/rules/python/testing.md +1 -5
- package/rules/swift/coding-style.md +1 -5
- package/rules/swift/hooks.md +1 -5
- package/rules/swift/patterns.md +1 -5
- package/rules/swift/security.md +1 -5
- package/rules/swift/testing.md +1 -5
- package/rules/typescript/coding-style.md +1 -5
- package/rules/typescript/hooks.md +1 -5
- package/rules/typescript/patterns.md +1 -5
- package/rules/typescript/security.md +1 -5
- package/rules/typescript/testing.md +1 -5
- package/rules/web/coding-style.md +3 -5
- package/rules/web/design-quality.md +3 -5
- package/rules/web/hooks.md +3 -5
- package/rules/web/patterns.md +3 -5
- package/rules/web/performance.md +3 -5
- package/rules/web/security.md +3 -5
- package/rules/web/testing.md +3 -5
- package/scripts/sync-specialists.mjs +20 -2
- package/skills/ai/agent-dev.md +4 -5
- package/skills/ai/llm-security.md +4 -5
- package/skills/ai/ml-ops.md +4 -5
- package/skills/ai/orchestration-workflow.md +4 -5
- package/skills/ai/prompt-and-eval.md +4 -5
- package/skills/ai/prompt-optimizer.md +4 -6
- package/skills/ai/rag-system.md +4 -5
- package/skills/architecture/api-design.md +4 -5
- package/skills/architecture/caching.md +4 -5
- package/skills/architecture/cloud-native.md +4 -5
- package/skills/architecture/message-queue.md +4 -5
- package/skills/architecture/security-arch.md +4 -5
- package/skills/compliance/ai-disclosure.md +4 -5
- package/skills/compliance/data-privacy.md +4 -5
- package/skills/compliance/license-audit.md +4 -5
- package/skills/compliance/regulatory-review.md +4 -5
- package/skills/development/cpp.md +4 -5
- package/skills/development/go.md +4 -5
- package/skills/development/java.md +4 -5
- package/skills/development/kotlin.md +4 -5
- package/skills/development/mobile-crossplatform.md +4 -5
- package/skills/development/python.md +4 -5
- package/skills/development/rust.md +4 -5
- package/skills/development/shell.md +4 -5
- package/skills/development/swift.md +4 -5
- package/skills/development/typescript.md +4 -5
- package/skills/devops/ci-cd.md +4 -5
- package/skills/devops/containerization.md +4 -5
- package/skills/devops/cost-optimization.md +4 -5
- package/skills/devops/data-engineering.md +4 -5
- package/skills/devops/database.md +4 -5
- package/skills/devops/dependency-management.md +4 -5
- package/skills/devops/devsecops.md +4 -5
- package/skills/devops/git-workflow.md +4 -5
- package/skills/devops/incident-response.md +4 -5
- package/skills/devops/monorepo.md +4 -5
- package/skills/devops/observability.md +4 -5
- package/skills/devops/performance.md +4 -5
- package/skills/devops/testing.md +4 -5
- package/skills/docs/adr-workflow.md +4 -7
- package/skills/docs/backlog-proposal-workflow.md +4 -3
- package/skills/docs/customer-profile-workflow.md +4 -3
- package/skills/docs/document-ingest-workflow.md +4 -3
- package/skills/docs/evidence-ingest-workflow.md +4 -3
- package/skills/docs/init-docs.md +4 -5
- package/skills/docs/init-project.md +4 -5
- package/skills/docs/prd-workflow.md +4 -7
- package/skills/docs/prfaq-workflow.md +4 -3
- package/skills/docs/product-intelligence-review.md +4 -3
- package/skills/docs/product-intelligence-workflow.md +4 -6
- package/skills/docs/product-signal-workflow.md +4 -5
- package/skills/docs/research-workflow.md +4 -5
- package/skills/docs/runbook-workflow.md +4 -5
- package/skills/docs/strategy-workflow.md +4 -5
- package/skills/exploration/dependency-graph-reading.md +4 -7
- package/skills/exploration/repo-map.md +4 -5
- package/skills/exploration/tracer-bullet-method.md +4 -7
- package/skills/exploration/unknown-codebase-onboarding.md +4 -7
- package/skills/frameworks/django.md +4 -5
- package/skills/frameworks/nextjs.md +4 -5
- package/skills/frameworks/react.md +4 -5
- package/skills/frameworks/spring-boot.md +4 -5
- package/skills/frontend-design/accessibility.md +4 -5
- package/skills/frontend-design/component-patterns.md +4 -5
- package/skills/frontend-design/engineering.md +4 -5
- package/skills/frontend-design/state-management.md +4 -5
- package/skills/frontend-design/ui-aesthetics.md +4 -5
- package/skills/frontend-design/ux-principles.md +4 -5
- package/skills/operating/change-management.md +4 -8
- package/skills/operating/incident-response.md +4 -8
- package/skills/operating/oncall-rotation.md +4 -7
- package/skills/operating/orchestration-reference.md +4 -10
- package/skills/quality-gates/review-work.md +4 -5
- package/skills/quality-gates/verify-change.md +4 -5
- package/skills/quality-gates/verify-module.md +4 -5
- package/skills/quality-gates/verify-quality.md +4 -5
- package/skills/quality-gates/verify-security.md +4 -5
- package/skills/roles/architect.ai-systems.md +6 -9
- package/skills/roles/architect.data.md +6 -9
- package/skills/roles/architect.enterprise.md +6 -9
- package/skills/roles/architect.integration.md +6 -9
- package/skills/roles/architect.md +7 -14
- package/skills/roles/architect.platform.md +6 -9
- package/skills/roles/data-analyst.experiment.md +6 -9
- package/skills/roles/data-analyst.md +6 -9
- package/skills/roles/data-analyst.product-intelligence.md +7 -9
- package/skills/roles/data-analyst.product.md +6 -9
- package/skills/roles/data-analyst.telemetry.md +7 -9
- package/skills/roles/data-engineer.pipeline.md +6 -9
- package/skills/roles/data-engineer.vector-retrieval.md +7 -9
- package/skills/roles/data-engineer.warehouse.md +6 -9
- package/skills/roles/debugger.md +6 -9
- package/skills/roles/designer.accessibility.md +6 -9
- package/skills/roles/designer.md +7 -9
- package/skills/roles/engineer.ai.md +6 -9
- package/skills/roles/engineer.data.md +6 -9
- package/skills/roles/engineer.md +9 -9
- package/skills/roles/engineer.platform.md +6 -9
- package/skills/roles/operator.docs.md +6 -9
- package/skills/roles/operator.md +9 -9
- package/skills/roles/operator.release.md +6 -9
- package/skills/roles/operator.sre.md +6 -9
- package/skills/roles/orchestrator.md +6 -9
- package/skills/roles/product-manager.ai-product.md +6 -9
- package/skills/roles/product-manager.business-strategy.md +6 -9
- package/skills/roles/product-manager.enterprise.md +6 -9
- package/skills/roles/product-manager.growth.md +7 -9
- package/skills/roles/product-manager.md +7 -9
- package/skills/roles/product-manager.platform.md +6 -9
- package/skills/roles/product-manager.product.md +6 -9
- package/skills/roles/qa.ai-eval.md +8 -9
- package/skills/roles/qa.api-contract.md +7 -9
- package/skills/roles/qa.data-pipeline.md +7 -9
- package/skills/roles/qa.md +7 -9
- package/skills/roles/qa.test-automation.md +6 -9
- package/skills/roles/qa.web-ui.md +7 -9
- package/skills/roles/researcher.explorer.md +6 -9
- package/skills/roles/researcher.md +8 -9
- package/skills/roles/researcher.ux.md +6 -9
- package/skills/roles/reviewer.devil-advocate.md +6 -9
- package/skills/roles/reviewer.evaluator.md +6 -9
- package/skills/roles/reviewer.md +9 -9
- package/skills/roles/reviewer.trace.md +6 -9
- package/skills/roles/security.ai.md +7 -9
- package/skills/roles/security.appsec.md +6 -9
- package/skills/roles/security.cloud.md +6 -9
- package/skills/roles/security.legal-compliance.md +6 -9
- package/skills/roles/security.md +7 -9
- package/skills/roles/security.privacy.md +7 -9
- package/skills/roles/security.supply-chain.md +7 -9
- package/skills/security/blue-team.md +4 -5
- package/skills/security/code-audit.md +4 -5
- package/skills/security/pentest.md +4 -5
- package/skills/security/red-team.md +4 -5
- package/skills/security/threat-intel.md +4 -5
- package/skills/security/vuln-research.md +4 -5
- package/skills/strategy/competitive-landscape.md +4 -8
- package/skills/strategy/market-research-methods.md +4 -8
- package/skills/strategy/narrative-arc.md +4 -8
- package/skills/strategy/pricing-positioning.md +4 -8
- package/skills/utility/clean-code.md +4 -5
- package/specialists/policy-inventory.json +14 -0
- package/lib/specialist-contracts-enforce.mjs +0 -172
- package/rules/common/agents.md +0 -28
- package/rules/common/development-workflow.md +0 -32
- package/rules/common/performance.md +0 -55
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/remember/runbook.md (Write a runbook) step-by-step procedure for a recurring task or incident
|
|
3
|
-
|
|
4
|
-
Write a runbook: step-by-step procedure for a recurring task or incident
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Write a runbook: step-by-step procedure for a recurring task or incident"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct. Write a runbook for: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
Structure:
|
package/commands/review/code.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/review/code.md (Code review) correctness, regressions, security, test coverage
|
|
3
|
-
|
|
4
|
-
Code review: correctness, regressions, security, test coverage
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Code review: correctness, regressions, security, test coverage"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct. Review: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
If no target specified, review all uncommitted changes (`git diff HEAD`).
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/review/quality.md (Quality audit) complexity, naming, duplication, dead code, maintainability
|
|
3
|
-
|
|
4
|
-
Quality audit: complexity, naming, duplication, dead code, maintainability
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Quality audit: complexity, naming, duplication, dead code, maintainability"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct. Audit quality for: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
Check:
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/review/security.md (Security scan) secrets, auth, injection, data exposure, dependency risk
|
|
3
|
-
|
|
4
|
-
Security scan: secrets, auth, injection, data exposure, dependency risk
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Security scan: secrets, auth, injection, data exposure, dependency risk"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct. Scan: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
If no target specified, scan all uncommitted changes.
|
package/commands/ship/ready.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/ship/ready.md (Pre-release check) is this ready to ship?
|
|
3
|
-
|
|
4
|
-
Pre-release check: is this ready to ship?
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Pre-release check: is this ready to ship?"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct. Check if the following is ready: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
Check:
|
package/commands/ship/release.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/ship/release.md (Release) plan rollout, changelog, rollback, and post-release verification
|
|
3
|
-
|
|
4
|
-
Release: plan rollout, changelog, rollback, and post-release verification
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Release: plan rollout, changelog, rollback, and post-release verification"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct. Release the following: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
Readiness checklist:
|
package/commands/ship/status.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/ship/status.md (Status) current project state, workflow, uncommitted changes, recent activity
|
|
3
|
-
|
|
4
|
-
Status: current project state, workflow, uncommitted changes, recent activity
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Status: current project state, workflow, uncommitted changes, recent activity"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct. Report status for: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
Check and report:
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/understand/docs.md (Look up documentation) current behavior from primary sources, not training memory
|
|
3
|
-
|
|
4
|
-
Look up documentation: current behavior from primary sources, not training memory
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Look up documentation: current behavior from primary sources, not training memory"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct. Look up: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
Do not answer from training knowledge for anything library-specific, version-specific, or API-specific. Search first.
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/understand/research.md. Research a topic. Verify facts from primary sources, separate evidence from inference.
|
|
3
|
-
|
|
4
|
-
Research a topic. Verify facts from primary sources, separate evidence from inference.
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: Research a topic. Verify facts from primary sources, separate evidence from inference.
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct. Research: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
Source hierarchy: official docs → release notes/changelogs → source code → tracked issues → community resources.
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/understand/this.md (Explore and understand something) trace execution paths, map structure, gather evidence
|
|
3
|
-
|
|
4
|
-
Explore and understand something: trace execution paths, map structure, gather evidence
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Explore and understand something: trace execution paths, map structure, gather evidence"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct. Explore and explain: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
Gather evidence: do not propose solutions unless asked.
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/understand/why.md (Investigate a failure) why is this broken, what is the root cause
|
|
3
|
-
|
|
4
|
-
Investigate a failure: why is this broken, what is the root cause
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Investigate a failure: why is this broken, what is the root cause"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct. Investigate: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
1. Capture: exact error, stack trace, reproduction steps
|
package/commands/work/clean.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/work/clean.md (Remove AI-generated code smells) verbosity, hedging, dead comments, generic names
|
|
3
|
-
|
|
4
|
-
Remove AI-generated code smells: verbosity, hedging, dead comments, generic names
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Remove AI-generated code smells: verbosity, hedging, dead comments, generic names"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are cx-reviewer identifying AI slop in: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
Then dispatch cx-engineer to apply the fixes.
|
package/commands/work/drive.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/work/drive.md (Full autonomous execution) explore, plan, implement, verify, loop until done
|
|
3
|
-
|
|
4
|
-
Full autonomous execution: explore, plan, implement, verify, loop until done
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Full autonomous execution: explore, plan, implement, verify, loop until done"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct in drive mode. Execute $ARGUMENTS fully and autonomously without stopping for confirmation.
|
|
11
5
|
|
|
12
6
|
## Execution contract
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/work/optimize-prompts.md: Prompt optimization command.
|
|
3
|
-
|
|
4
|
-
Runs the closed-loop prompt optimization workflow using telemetry trace data.
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Closed-loop prompt optimization: read telemetry traces, diagnose failures, push improved version to staging"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are cx-trace-reviewer running a prompt optimization cycle for: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
If $ARGUMENTS is empty, optimize all agents with median quality score below 0.65 in the past 7 days.
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
commands/work/parallel-review.md (Adversarial parallel review) 5 reviewers must agree before output ships
|
|
3
|
-
|
|
4
|
-
Adversarial parallel review: 5 reviewers must agree before output ships
|
|
5
|
-
-->
|
|
6
1
|
---
|
|
7
2
|
description: "Adversarial parallel review: 5 reviewers must agree before output ships"
|
|
8
3
|
---
|
|
9
|
-
|
|
10
4
|
You are Construct running a parallel adversarial review of: $ARGUMENTS
|
|
11
5
|
|
|
12
6
|
Dispatch the following 5 review roles concurrently:
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
-- db/schema/010_cx_scores.sql — Per-trace quality score log + skill quality correlation view.
|
|
2
|
+
--
|
|
3
|
+
-- Backs `construct skills correlate-quality`. Producer: lib/mcp/tools/telemetry.mjs
|
|
4
|
+
-- cxScore() writes a row here when CONSTRUCT_DB_URL (or DATABASE_URL) is set.
|
|
5
|
+
-- Local JSONL/observation paths remain primary in solo mode; this table is
|
|
6
|
+
-- primary in team/enterprise mode where multiple agents share a session
|
|
7
|
+
-- timeline and the dashboard reads aggregate correlations.
|
|
8
|
+
|
|
9
|
+
create table if not exists construct_cx_scores (
|
|
10
|
+
id bigserial primary key,
|
|
11
|
+
ts timestamptz not null,
|
|
12
|
+
trace_id text not null,
|
|
13
|
+
session_id text,
|
|
14
|
+
agent_id text,
|
|
15
|
+
name text not null default 'quality',
|
|
16
|
+
value numeric not null,
|
|
17
|
+
comment text
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
create index if not exists construct_cx_scores_trace_idx
|
|
21
|
+
on construct_cx_scores (trace_id);
|
|
22
|
+
|
|
23
|
+
create index if not exists construct_cx_scores_session_ts_idx
|
|
24
|
+
on construct_cx_scores (session_id, ts desc);
|
|
25
|
+
|
|
26
|
+
create index if not exists construct_cx_scores_agent_ts_idx
|
|
27
|
+
on construct_cx_scores (agent_id, ts desc);
|
|
28
|
+
|
|
29
|
+
-- Skill quality correlation view: joins skill invocations and quality
|
|
30
|
+
-- scores by session_id so a reader can ask "for sessions where skill X was
|
|
31
|
+
-- invoked, what's the median / mean / p10 quality score?" The view is a
|
|
32
|
+
-- simple aggregate over the past 90 days; queries that need a longer
|
|
33
|
+
-- window can pull straight from the underlying tables. Materialised view
|
|
34
|
+
-- not used here because the correlation surface is small and the freshness
|
|
35
|
+
-- expectation is "current session" not "yesterday's batch."
|
|
36
|
+
|
|
37
|
+
create or replace view construct_skill_quality_correlation as
|
|
38
|
+
select
|
|
39
|
+
inv.skill_id,
|
|
40
|
+
count(distinct inv.session_id) as sessions,
|
|
41
|
+
count(distinct sc.id) as score_count,
|
|
42
|
+
round(avg(sc.value)::numeric, 3) as mean_score,
|
|
43
|
+
round((percentile_cont(0.5) within group (order by sc.value))::numeric, 3) as median_score,
|
|
44
|
+
round((percentile_cont(0.10) within group (order by sc.value))::numeric, 3) as p10_score,
|
|
45
|
+
round((percentile_cont(0.90) within group (order by sc.value))::numeric, 3) as p90_score,
|
|
46
|
+
max(sc.ts) as last_scored_at
|
|
47
|
+
from construct_skill_invocations inv
|
|
48
|
+
inner join construct_cx_scores sc on sc.session_id = inv.session_id
|
|
49
|
+
where inv.ts > now() - interval '90 days'
|
|
50
|
+
and sc.ts > now() - interval '90 days'
|
|
51
|
+
group by inv.skill_id;
|
package/lib/beads-client.mjs
CHANGED
|
@@ -28,6 +28,21 @@ import {
|
|
|
28
28
|
cleanupStaleQueue,
|
|
29
29
|
} from './beads-lock.mjs';
|
|
30
30
|
|
|
31
|
+
// Anchored bead-ID format. IDs reaching the bd shell boundary must match this;
|
|
32
|
+
// regex-extracted IDs from PR bodies, agent transcripts, or intake packets get
|
|
33
|
+
// re-validated here so a malformed value cannot reach the database. spawnSync
|
|
34
|
+
// uses argv-array form so shell injection isn't the failure mode — log
|
|
35
|
+
// corruption from a bogus ID is.
|
|
36
|
+
|
|
37
|
+
const BEAD_ID_RE = /^[a-z]+-[a-z0-9]+$/;
|
|
38
|
+
|
|
39
|
+
export function assertBeadId(id) {
|
|
40
|
+
if (typeof id !== 'string' || !BEAD_ID_RE.test(id)) {
|
|
41
|
+
throw new Error(`bd: invalid bead id ${JSON.stringify(id)} — expected prefix-suffix slug`);
|
|
42
|
+
}
|
|
43
|
+
return id;
|
|
44
|
+
}
|
|
45
|
+
|
|
31
46
|
import {
|
|
32
47
|
concurrentRead,
|
|
33
48
|
optimisticWrite,
|
|
@@ -253,7 +268,7 @@ async function runWithLegacyLock(args, opts, cwd, commandDesc) {
|
|
|
253
268
|
if (!lock) {
|
|
254
269
|
// Failed to get lock; add to queue if allowed
|
|
255
270
|
const maxQueueWaitMs = opts.maxQueueWaitSeconds * 1000;
|
|
256
|
-
if (Date.now() - startWait
|
|
271
|
+
if (Date.now() - startWait > maxQueueWaitMs) {
|
|
257
272
|
return {
|
|
258
273
|
success: false,
|
|
259
274
|
error: `Timeout waiting for lock after ${opts.timeoutSeconds}s`,
|
|
@@ -365,6 +380,7 @@ export async function listIssues(options = {}) {
|
|
|
365
380
|
* Uses concurrent read (no locking needed).
|
|
366
381
|
*/
|
|
367
382
|
export async function showIssue(id, options = {}) {
|
|
383
|
+
assertBeadId(id);
|
|
368
384
|
return runBdJson(['show', id], { useOptimisticLocking: true, ...options });
|
|
369
385
|
}
|
|
370
386
|
|
|
@@ -373,6 +389,7 @@ export async function showIssue(id, options = {}) {
|
|
|
373
389
|
* Uses optimistic locking for better concurrency.
|
|
374
390
|
*/
|
|
375
391
|
export async function claimIssue(id, options = {}) {
|
|
392
|
+
assertBeadId(id);
|
|
376
393
|
// Use the specialized optimistic claim function
|
|
377
394
|
const result = await claimBeadOptimistic(id, options);
|
|
378
395
|
|
|
@@ -388,6 +405,7 @@ export async function claimIssue(id, options = {}) {
|
|
|
388
405
|
* Close an issue.
|
|
389
406
|
*/
|
|
390
407
|
export async function closeIssue(id, options = {}) {
|
|
408
|
+
assertBeadId(id);
|
|
391
409
|
return runBd(['close', id], options);
|
|
392
410
|
}
|
|
393
411
|
|