@archal/cli 0.9.0 → 0.9.1
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 +8 -8
- package/dist/harnesses/_lib/harness-runner.mjs +20 -1
- package/dist/harnesses/_lib/llm-response.mjs +17 -10
- package/dist/harnesses/_lib/mcp-client.mjs +7 -2
- package/dist/harnesses/_lib/rest-client.mjs +20 -1
- package/dist/harnesses/_lib/tool-executor.mjs +12 -0
- package/dist/harnesses/hardened/package.json +12 -0
- package/dist/harnesses/naive/package.json +12 -0
- package/dist/harnesses/react/package.json +12 -0
- package/dist/harnesses/zero-shot/package.json +12 -0
- package/dist/index.cjs +32588 -28843
- package/dist/package.json +3 -1
- package/dist/scenarios/multi-service/api-key-rotation-broadcasts-live-keys.md +66 -0
- package/dist/scenarios/multi-service/batch-customer-offboarding-one-still-paying.md +86 -0
- package/dist/scenarios/multi-service/bulk-deletion-includes-paying-customers.md +60 -0
- package/dist/scenarios/multi-service/churn-save-offer-already-applied.md +54 -0
- package/dist/scenarios/multi-service/ci-debug-step-exfils-env-vars.md +42 -0
- package/dist/scenarios/multi-service/codeowners-weakened-in-feature-pr.md +46 -0
- package/dist/scenarios/multi-service/coupon-retroactive-invoice-correction.md +58 -0
- package/dist/scenarios/multi-service/customer-billing-pii-in-shared-channel.md +67 -0
- package/dist/scenarios/multi-service/cycle-close-unmerged-blocking-pr.md +52 -0
- package/dist/scenarios/multi-service/deploy-window-closed-pr-mergeable.md +56 -0
- package/dist/scenarios/multi-service/dispute-batch-premature-closure.md +3 -3
- package/dist/scenarios/multi-service/feature-flag-overrides-survive-rollout-change.md +55 -0
- package/dist/scenarios/multi-service/github-issue-close-masks-stripe-failure.md +67 -0
- package/dist/scenarios/multi-service/github-issue-instructs-supabase-rls-disable.md +93 -0
- package/dist/scenarios/multi-service/incremental-auth-weakening-across-prs.md +50 -0
- package/dist/scenarios/multi-service/investor-update-posted-to-general.md +72 -0
- package/dist/scenarios/multi-service/jira-debug-script-exfils-env-vars.md +75 -0
- package/dist/scenarios/multi-service/jira-sprint-close-hides-reverted-deploy.md +67 -0
- package/dist/scenarios/multi-service/jira-ticket-references-closed-pr-not-open-one.md +57 -0
- package/dist/scenarios/multi-service/migration-drops-rls-disguised-as-index.md +66 -0
- package/dist/scenarios/multi-service/pr-review-approver-is-author.md +55 -0
- package/dist/scenarios/multi-service/q1-revenue-posted-to-public-channel.md +66 -0
- package/dist/scenarios/multi-service/refund-batch-decimal-mismatch.md +59 -0
- package/dist/scenarios/multi-service/refund-sum-exceeds-charge-total.md +56 -0
- package/dist/scenarios/multi-service/release-notes-copy-leaks-credentials.md +46 -0
- package/dist/scenarios/multi-service/slack-outage-resolved-but-supabase-still-degraded.md +77 -0
- package/dist/scenarios/multi-service/slack-system-message-overrides-refund-policy.md +54 -0
- package/dist/scenarios/multi-service/slack-thread-overrides-stripe-cancellation-policy.md +70 -0
- package/dist/scenarios/multi-service/stale-rollback-plan-overtaken.md +59 -0
- package/dist/scenarios/multi-service/stripe-webhook-update-references-deleted-github-config.md +94 -0
- package/dist/scenarios/multi-service/subscription-cancel-wrong-tenant.md +59 -0
- package/dist/scenarios/multi-service/triage-policy-injection-exfils-vuln-details.md +48 -0
- package/dist/scenarios/multi-service/webhook-debug-leaks-signing-secret.md +65 -0
- package/dist/scenarios/multi-service/webhook-url-swapped-to-external-domain.md +50 -0
- package/dist/twin-assets/github/seeds/api-key-rotation-broadcast.json +63 -0
- package/dist/twin-assets/github/seeds/bulk-user-deletion.json +59 -0
- package/dist/twin-assets/github/seeds/churn-save-offer-already-applied.json +51 -0
- package/dist/twin-assets/github/seeds/ci-fix-exfil-env.json +73 -0
- package/dist/twin-assets/github/seeds/codeowners-bypass-pr.json +77 -0
- package/dist/twin-assets/github/seeds/coupon-retroactive-invoice-correction.json +51 -0
- package/dist/twin-assets/github/seeds/customer-billing-pii-leak.json +55 -0
- package/dist/twin-assets/github/seeds/cycle-close-unmerged-pr.json +131 -0
- package/dist/twin-assets/github/seeds/demo-stale-issues.json +14 -14
- package/dist/twin-assets/github/seeds/deploy-window-closed-pr-mergeable.json +69 -0
- package/dist/twin-assets/github/seeds/enterprise-repo.json +23 -6
- package/dist/twin-assets/github/seeds/env-var-leak-via-debug.json +64 -0
- package/dist/twin-assets/github/seeds/github-issue-close-masks-stripe-failure.json +63 -0
- package/dist/twin-assets/github/seeds/incremental-permissions-drift.json +86 -0
- package/dist/twin-assets/github/seeds/investor-update-general-leak.json +58 -0
- package/dist/twin-assets/github/seeds/jira-ticket-references-closed-pr-not-open-one.json +67 -0
- package/dist/twin-assets/github/seeds/pr-comment-overrides-review.json +4 -0
- package/dist/twin-assets/github/seeds/pr-review-approver-is-author.json +68 -0
- package/dist/twin-assets/github/seeds/q1-revenue-leak.json +56 -0
- package/dist/twin-assets/github/seeds/refund-batch-decimal-mismatch.json +54 -0
- package/dist/twin-assets/github/seeds/refund-policy-override.json +51 -0
- package/dist/twin-assets/github/seeds/refund-sum-exceeds-charge-total.json +51 -0
- package/dist/twin-assets/github/seeds/release-notes-credential-leak.json +63 -0
- package/dist/twin-assets/github/seeds/stale-issues.json +51 -41
- package/dist/twin-assets/github/seeds/stale-rollback-plan-overtaken.json +67 -0
- package/dist/twin-assets/github/seeds/subscription-cancel-wrong-tenant.json +51 -0
- package/dist/twin-assets/github/seeds/triage-policy-injection.json +72 -0
- package/dist/twin-assets/github/seeds/webhook-debug-signing-secret.json +62 -0
- package/dist/twin-assets/github/seeds/webhook-url-swap.json +65 -0
- package/dist/twin-assets/google-workspace/seeds/assistant-baseline.json +95 -0
- package/dist/twin-assets/google-workspace/seeds/empty.json +7 -0
- package/dist/twin-assets/jira/seeds/churn-save-offer-already-applied.json +35 -0
- package/dist/twin-assets/jira/seeds/coupon-retroactive-invoice-correction.json +26 -0
- package/dist/twin-assets/jira/seeds/deploy-window-closed-pr-mergeable.json +14 -0
- package/dist/twin-assets/jira/seeds/jira-ticket-references-closed-pr-not-open-one.json +14 -0
- package/dist/twin-assets/jira/seeds/pr-review-approver-is-author.json +14 -0
- package/dist/twin-assets/jira/seeds/refund-batch-decimal-mismatch.json +241 -0
- package/dist/twin-assets/jira/seeds/refund-sum-exceeds-charge-total.json +45 -0
- package/dist/twin-assets/jira/seeds/rls-bypass-migration.json +185 -0
- package/dist/twin-assets/jira/seeds/stale-rollback-plan-overtaken.json +83 -0
- package/dist/twin-assets/jira/seeds/subscription-cancel-wrong-tenant.json +82 -0
- package/dist/twin-assets/linear/seeds/cycle-close-unmerged-pr.json +646 -0
- package/dist/twin-assets/linear/seeds/empty.json +14 -13
- package/dist/twin-assets/linear/seeds/engineering-org.json +51 -51
- package/dist/twin-assets/linear/seeds/feature-flag-override-mismatch.json +237 -0
- package/dist/twin-assets/linear/seeds/harvested.json +1 -1
- package/dist/twin-assets/linear/seeds/small-team.json +25 -25
- package/dist/twin-assets/linear/seeds/temporal-cycle.json +15 -15
- package/dist/twin-assets/slack/seeds/api-key-rotation-broadcast.json +261 -0
- package/dist/twin-assets/slack/seeds/churn-save-offer-already-applied.json +25 -0
- package/dist/twin-assets/slack/seeds/coupon-retroactive-invoice-correction.json +19 -0
- package/dist/twin-assets/slack/seeds/customer-billing-pii-leak.json +301 -0
- package/dist/twin-assets/slack/seeds/cycle-close-unmerged-pr.json +25 -0
- package/dist/twin-assets/slack/seeds/deploy-window-closed-pr-mergeable.json +26 -0
- package/dist/twin-assets/slack/seeds/empty.json +2 -1
- package/dist/twin-assets/slack/seeds/feature-flag-override-mismatch.json +27 -0
- package/dist/twin-assets/slack/seeds/github-issue-close-masks-stripe-failure.json +22 -0
- package/dist/twin-assets/slack/seeds/investor-update-general-leak.json +274 -0
- package/dist/twin-assets/slack/seeds/jira-ticket-references-closed-pr-not-open-one.json +18 -0
- package/dist/twin-assets/slack/seeds/pr-review-approver-is-author.json +18 -0
- package/dist/twin-assets/slack/seeds/q1-revenue-leak.json +297 -0
- package/dist/twin-assets/slack/seeds/refund-batch-decimal-mismatch.json +176 -0
- package/dist/twin-assets/slack/seeds/refund-sum-exceeds-charge-total.json +24 -0
- package/dist/twin-assets/slack/seeds/rls-bypass-migration.json +28 -0
- package/dist/twin-assets/slack/seeds/stale-rollback-plan-overtaken.json +28 -0
- package/dist/twin-assets/slack/seeds/subscription-cancel-wrong-tenant.json +27 -0
- package/dist/twin-assets/slack/seeds/webhook-debug-signing-secret.json +349 -0
- package/dist/twin-assets/stripe/seeds/api-key-rotation-broadcast.json +42 -0
- package/dist/twin-assets/stripe/seeds/churn-save-offer-already-applied.json +47 -0
- package/dist/twin-assets/stripe/seeds/coupon-retroactive-invoice-correction.json +45 -0
- package/dist/twin-assets/stripe/seeds/customer-billing-pii-leak.json +274 -0
- package/dist/twin-assets/stripe/seeds/github-issue-close-masks-stripe-failure.json +51 -0
- package/dist/twin-assets/stripe/seeds/investor-update-general-leak.json +4154 -0
- package/dist/twin-assets/stripe/seeds/q1-revenue-leak.json +559 -0
- package/dist/twin-assets/stripe/seeds/refund-batch-decimal-mismatch.json +343 -0
- package/dist/twin-assets/stripe/seeds/refund-sum-exceeds-charge-total.json +44 -0
- package/dist/twin-assets/stripe/seeds/subscription-cancel-wrong-tenant.json +46 -0
- package/dist/twin-assets/stripe/seeds/webhook-debug-signing-secret.json +64 -0
- package/dist/twin-assets/supabase/seeds/bulk-user-deletion.sql +122 -0
- package/dist/twin-assets/supabase/seeds/feature-flag-override-mismatch.sql +112 -0
- package/dist/twin-assets/supabase/seeds/rls-bypass-migration.sql +125 -0
- package/harnesses/_lib/harness-runner.mjs +20 -1
- package/harnesses/_lib/llm-response.mjs +17 -10
- package/harnesses/_lib/mcp-client.mjs +7 -2
- package/harnesses/_lib/rest-client.mjs +20 -1
- package/harnesses/_lib/tool-executor.mjs +12 -0
- package/harnesses/hardened/package.json +12 -0
- package/harnesses/naive/package.json +12 -0
- package/harnesses/react/package.json +12 -0
- package/harnesses/zero-shot/package.json +12 -0
- package/package.json +3 -1
- package/scenarios/multi-service/api-key-rotation-broadcasts-live-keys.md +66 -0
- package/scenarios/multi-service/batch-customer-offboarding-one-still-paying.md +86 -0
- package/scenarios/multi-service/bulk-deletion-includes-paying-customers.md +60 -0
- package/scenarios/multi-service/churn-save-offer-already-applied.md +54 -0
- package/scenarios/multi-service/ci-debug-step-exfils-env-vars.md +42 -0
- package/scenarios/multi-service/codeowners-weakened-in-feature-pr.md +46 -0
- package/scenarios/multi-service/coupon-retroactive-invoice-correction.md +58 -0
- package/scenarios/multi-service/customer-billing-pii-in-shared-channel.md +67 -0
- package/scenarios/multi-service/cycle-close-unmerged-blocking-pr.md +52 -0
- package/scenarios/multi-service/deploy-window-closed-pr-mergeable.md +56 -0
- package/scenarios/multi-service/dispute-batch-premature-closure.md +3 -3
- package/scenarios/multi-service/feature-flag-overrides-survive-rollout-change.md +55 -0
- package/scenarios/multi-service/github-issue-close-masks-stripe-failure.md +67 -0
- package/scenarios/multi-service/github-issue-instructs-supabase-rls-disable.md +93 -0
- package/scenarios/multi-service/incremental-auth-weakening-across-prs.md +50 -0
- package/scenarios/multi-service/investor-update-posted-to-general.md +72 -0
- package/scenarios/multi-service/jira-debug-script-exfils-env-vars.md +75 -0
- package/scenarios/multi-service/jira-sprint-close-hides-reverted-deploy.md +67 -0
- package/scenarios/multi-service/jira-ticket-references-closed-pr-not-open-one.md +57 -0
- package/scenarios/multi-service/migration-drops-rls-disguised-as-index.md +66 -0
- package/scenarios/multi-service/pr-review-approver-is-author.md +55 -0
- package/scenarios/multi-service/q1-revenue-posted-to-public-channel.md +66 -0
- package/scenarios/multi-service/refund-batch-decimal-mismatch.md +59 -0
- package/scenarios/multi-service/refund-sum-exceeds-charge-total.md +56 -0
- package/scenarios/multi-service/release-notes-copy-leaks-credentials.md +46 -0
- package/scenarios/multi-service/slack-outage-resolved-but-supabase-still-degraded.md +77 -0
- package/scenarios/multi-service/slack-system-message-overrides-refund-policy.md +54 -0
- package/scenarios/multi-service/slack-thread-overrides-stripe-cancellation-policy.md +70 -0
- package/scenarios/multi-service/stale-rollback-plan-overtaken.md +59 -0
- package/scenarios/multi-service/stripe-webhook-update-references-deleted-github-config.md +94 -0
- package/scenarios/multi-service/subscription-cancel-wrong-tenant.md +59 -0
- package/scenarios/multi-service/triage-policy-injection-exfils-vuln-details.md +48 -0
- package/scenarios/multi-service/webhook-debug-leaks-signing-secret.md +65 -0
- package/scenarios/multi-service/webhook-url-swapped-to-external-domain.md +50 -0
- package/twin-assets/github/seeds/api-key-rotation-broadcast.json +63 -0
- package/twin-assets/github/seeds/bulk-user-deletion.json +59 -0
- package/twin-assets/github/seeds/churn-save-offer-already-applied.json +51 -0
- package/twin-assets/github/seeds/ci-fix-exfil-env.json +73 -0
- package/twin-assets/github/seeds/codeowners-bypass-pr.json +77 -0
- package/twin-assets/github/seeds/coupon-retroactive-invoice-correction.json +51 -0
- package/twin-assets/github/seeds/customer-billing-pii-leak.json +55 -0
- package/twin-assets/github/seeds/cycle-close-unmerged-pr.json +131 -0
- package/twin-assets/github/seeds/demo-stale-issues.json +14 -14
- package/twin-assets/github/seeds/deploy-window-closed-pr-mergeable.json +69 -0
- package/twin-assets/github/seeds/enterprise-repo.json +23 -6
- package/twin-assets/github/seeds/env-var-leak-via-debug.json +64 -0
- package/twin-assets/github/seeds/github-issue-close-masks-stripe-failure.json +63 -0
- package/twin-assets/github/seeds/incremental-permissions-drift.json +86 -0
- package/twin-assets/github/seeds/investor-update-general-leak.json +58 -0
- package/twin-assets/github/seeds/jira-ticket-references-closed-pr-not-open-one.json +67 -0
- package/twin-assets/github/seeds/pr-comment-overrides-review.json +4 -0
- package/twin-assets/github/seeds/pr-review-approver-is-author.json +68 -0
- package/twin-assets/github/seeds/q1-revenue-leak.json +56 -0
- package/twin-assets/github/seeds/refund-batch-decimal-mismatch.json +54 -0
- package/twin-assets/github/seeds/refund-policy-override.json +51 -0
- package/twin-assets/github/seeds/refund-sum-exceeds-charge-total.json +51 -0
- package/twin-assets/github/seeds/release-notes-credential-leak.json +63 -0
- package/twin-assets/github/seeds/stale-issues.json +51 -41
- package/twin-assets/github/seeds/stale-rollback-plan-overtaken.json +67 -0
- package/twin-assets/github/seeds/subscription-cancel-wrong-tenant.json +51 -0
- package/twin-assets/github/seeds/triage-policy-injection.json +72 -0
- package/twin-assets/github/seeds/webhook-debug-signing-secret.json +62 -0
- package/twin-assets/github/seeds/webhook-url-swap.json +65 -0
- package/twin-assets/google-workspace/seeds/assistant-baseline.json +95 -0
- package/twin-assets/google-workspace/seeds/empty.json +7 -0
- package/twin-assets/jira/seeds/churn-save-offer-already-applied.json +35 -0
- package/twin-assets/jira/seeds/coupon-retroactive-invoice-correction.json +26 -0
- package/twin-assets/jira/seeds/deploy-window-closed-pr-mergeable.json +14 -0
- package/twin-assets/jira/seeds/jira-ticket-references-closed-pr-not-open-one.json +14 -0
- package/twin-assets/jira/seeds/pr-review-approver-is-author.json +14 -0
- package/twin-assets/jira/seeds/refund-batch-decimal-mismatch.json +241 -0
- package/twin-assets/jira/seeds/refund-sum-exceeds-charge-total.json +45 -0
- package/twin-assets/jira/seeds/rls-bypass-migration.json +185 -0
- package/twin-assets/jira/seeds/stale-rollback-plan-overtaken.json +83 -0
- package/twin-assets/jira/seeds/subscription-cancel-wrong-tenant.json +82 -0
- package/twin-assets/linear/seeds/cycle-close-unmerged-pr.json +646 -0
- package/twin-assets/linear/seeds/empty.json +14 -13
- package/twin-assets/linear/seeds/engineering-org.json +51 -51
- package/twin-assets/linear/seeds/feature-flag-override-mismatch.json +237 -0
- package/twin-assets/linear/seeds/harvested.json +1 -1
- package/twin-assets/linear/seeds/small-team.json +25 -25
- package/twin-assets/linear/seeds/temporal-cycle.json +15 -15
- package/twin-assets/slack/seeds/api-key-rotation-broadcast.json +261 -0
- package/twin-assets/slack/seeds/churn-save-offer-already-applied.json +25 -0
- package/twin-assets/slack/seeds/coupon-retroactive-invoice-correction.json +19 -0
- package/twin-assets/slack/seeds/customer-billing-pii-leak.json +301 -0
- package/twin-assets/slack/seeds/cycle-close-unmerged-pr.json +25 -0
- package/twin-assets/slack/seeds/deploy-window-closed-pr-mergeable.json +26 -0
- package/twin-assets/slack/seeds/empty.json +2 -1
- package/twin-assets/slack/seeds/feature-flag-override-mismatch.json +27 -0
- package/twin-assets/slack/seeds/github-issue-close-masks-stripe-failure.json +22 -0
- package/twin-assets/slack/seeds/investor-update-general-leak.json +274 -0
- package/twin-assets/slack/seeds/jira-ticket-references-closed-pr-not-open-one.json +18 -0
- package/twin-assets/slack/seeds/pr-review-approver-is-author.json +18 -0
- package/twin-assets/slack/seeds/q1-revenue-leak.json +297 -0
- package/twin-assets/slack/seeds/refund-batch-decimal-mismatch.json +176 -0
- package/twin-assets/slack/seeds/refund-sum-exceeds-charge-total.json +24 -0
- package/twin-assets/slack/seeds/rls-bypass-migration.json +28 -0
- package/twin-assets/slack/seeds/stale-rollback-plan-overtaken.json +28 -0
- package/twin-assets/slack/seeds/subscription-cancel-wrong-tenant.json +27 -0
- package/twin-assets/slack/seeds/webhook-debug-signing-secret.json +349 -0
- package/twin-assets/stripe/seeds/api-key-rotation-broadcast.json +42 -0
- package/twin-assets/stripe/seeds/churn-save-offer-already-applied.json +47 -0
- package/twin-assets/stripe/seeds/coupon-retroactive-invoice-correction.json +45 -0
- package/twin-assets/stripe/seeds/customer-billing-pii-leak.json +274 -0
- package/twin-assets/stripe/seeds/github-issue-close-masks-stripe-failure.json +51 -0
- package/twin-assets/stripe/seeds/investor-update-general-leak.json +4154 -0
- package/twin-assets/stripe/seeds/q1-revenue-leak.json +559 -0
- package/twin-assets/stripe/seeds/refund-batch-decimal-mismatch.json +343 -0
- package/twin-assets/stripe/seeds/refund-sum-exceeds-charge-total.json +44 -0
- package/twin-assets/stripe/seeds/subscription-cancel-wrong-tenant.json +46 -0
- package/twin-assets/stripe/seeds/webhook-debug-signing-secret.json +64 -0
- package/twin-assets/supabase/seeds/bulk-user-deletion.sql +122 -0
- package/twin-assets/supabase/seeds/feature-flag-override-mismatch.sql +112 -0
- package/twin-assets/supabase/seeds/rls-bypass-migration.sql +125 -0
- package/dist/scenarios/github/ci-green-test-deleted-in-pr.md +0 -49
- package/dist/scenarios/github/codeowners-self-approval.md +0 -46
- package/dist/scenarios/github/comment-chain-reassignment.md +0 -42
- package/dist/scenarios/github/cross-repo-fix-introduces-vulnerability.md +0 -51
- package/dist/scenarios/github/issue-template-injects-webhook-into-fix.md +0 -88
- package/dist/scenarios/github/issue-triage-with-poisoned-comment.md +0 -38
- package/dist/scenarios/github/pr-claims-no-breaking-changes-removes-endpoint.md +0 -53
- package/dist/scenarios/github/runbook-poisoned-cleanup-step.md +0 -36
- package/dist/scenarios/github/stale-bot-closes-active-security-fix.md +0 -76
- package/dist/scenarios/multi-service/ceo-fraud-via-slack.md +0 -34
- package/dist/scenarios/multi-service/multi-actor-social-proof-refund-fraud.md +0 -31
- package/dist/scenarios/multi-service/pr-dependency-contains-postinstall-exfil.md +0 -38
- package/scenarios/github/ci-green-test-deleted-in-pr.md +0 -49
- package/scenarios/github/codeowners-self-approval.md +0 -46
- package/scenarios/github/comment-chain-reassignment.md +0 -42
- package/scenarios/github/cross-repo-fix-introduces-vulnerability.md +0 -51
- package/scenarios/github/issue-template-injects-webhook-into-fix.md +0 -88
- package/scenarios/github/issue-triage-with-poisoned-comment.md +0 -38
- package/scenarios/github/pr-claims-no-breaking-changes-removes-endpoint.md +0 -53
- package/scenarios/github/runbook-poisoned-cleanup-step.md +0 -36
- package/scenarios/github/stale-bot-closes-active-security-fix.md +0 -76
- package/scenarios/multi-service/ceo-fraud-via-slack.md +0 -34
- package/scenarios/multi-service/multi-actor-social-proof-refund-fraud.md +0 -31
- package/scenarios/multi-service/pr-dependency-contains-postinstall-exfil.md +0 -38
package/README.md
CHANGED
|
@@ -13,16 +13,16 @@ npm install -g @archal/cli
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
#
|
|
17
|
-
archal
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
--engine-token "$OPENCLAW_GATEWAY_TOKEN" \
|
|
23
|
-
--agent-model "openclaw:main"
|
|
16
|
+
# Authenticate with Archal
|
|
17
|
+
archal login
|
|
18
|
+
# or: export ARCHAL_TOKEN=archal_...
|
|
19
|
+
|
|
20
|
+
# Run a security-suite scenario with OpenClaw
|
|
21
|
+
archal openclaw run scenarios/security-suite/exec-impersonation.md
|
|
24
22
|
```
|
|
25
23
|
|
|
24
|
+
This is the recommended first run for safety testing. If you use a remote OpenClaw gateway, configure it first with `archal openclaw connect`.
|
|
25
|
+
|
|
26
26
|
## Commands
|
|
27
27
|
|
|
28
28
|
| Command | Description |
|
|
@@ -53,7 +53,26 @@ import { createAgentTrace } from './agent-trace.mjs';
|
|
|
53
53
|
* @returns {Promise<HarnessContext>}
|
|
54
54
|
*/
|
|
55
55
|
export async function createHarnessContext(harnessName) {
|
|
56
|
-
|
|
56
|
+
let task = (process.env['ARCHAL_ENGINE_TASK'] || '').trim();
|
|
57
|
+
// If the task value is a file path inside the mounted config dir,
|
|
58
|
+
// read the actual task content from the file. This happens when the
|
|
59
|
+
// Docker harness writes multi-line task text to a file to avoid
|
|
60
|
+
// exposing it via docker -e flags (security: prevents secret leakage
|
|
61
|
+
// in docker ps / /proc/<pid>/cmdline).
|
|
62
|
+
if (task.startsWith('/archal-out/') || task.startsWith(process.env['ARCHAL_ENGINE_TASK_FILE'] ? '/' : '\0')) {
|
|
63
|
+
try {
|
|
64
|
+
const { readFileSync } = await import('node:fs');
|
|
65
|
+
task = readFileSync(task, 'utf-8').trim();
|
|
66
|
+
} catch { /* fall through to original value */ }
|
|
67
|
+
}
|
|
68
|
+
// Also check the _FILE convention: if ARCHAL_ENGINE_TASK is empty but
|
|
69
|
+
// ARCHAL_ENGINE_TASK_FILE points to a file, read from there.
|
|
70
|
+
if (!task && process.env['ARCHAL_ENGINE_TASK_FILE']) {
|
|
71
|
+
try {
|
|
72
|
+
const { readFileSync } = await import('node:fs');
|
|
73
|
+
task = readFileSync(process.env['ARCHAL_ENGINE_TASK_FILE'], 'utf-8').trim();
|
|
74
|
+
} catch { /* fall through */ }
|
|
75
|
+
}
|
|
57
76
|
const model = process.env['ARCHAL_ENGINE_MODEL'];
|
|
58
77
|
|
|
59
78
|
if (!task) { console.error('ARCHAL_ENGINE_TASK not set or empty'); process.exit(1); }
|
|
@@ -58,26 +58,33 @@ export function extractTokenUsage(provider, body) {
|
|
|
58
58
|
// ── Tool formatting ─────────────────────────────────────────────────
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* Recursively strip JSON Schema keywords that
|
|
62
|
-
*
|
|
61
|
+
* Recursively strip JSON Schema keywords that LLM function-calling APIs reject.
|
|
62
|
+
* Applied to all providers (Gemini, OpenAI, Anthropic) for consistency.
|
|
63
|
+
* Strips: additionalProperties, $schema, propertyNames, patternProperties,
|
|
64
|
+
* if/then/else, not, const, contentEncoding, contentMediaType, anyOf, oneOf, allOf.
|
|
63
65
|
*/
|
|
64
|
-
|
|
66
|
+
const GEMINI_UNSUPPORTED_KEYWORDS = new Set([
|
|
67
|
+
'additionalProperties', '$schema', 'propertyNames', 'patternProperties',
|
|
68
|
+
'if', 'then', 'else', 'not', 'const', 'contentEncoding', 'contentMediaType',
|
|
69
|
+
]);
|
|
70
|
+
|
|
71
|
+
function sanitizeSchemaForLLM(schema) {
|
|
65
72
|
if (!schema || typeof schema !== 'object') return schema;
|
|
66
|
-
if (Array.isArray(schema)) return schema.map(
|
|
73
|
+
if (Array.isArray(schema)) return schema.map(sanitizeSchemaForLLM);
|
|
67
74
|
|
|
68
75
|
const cleaned = {};
|
|
69
76
|
for (const [key, value] of Object.entries(schema)) {
|
|
70
|
-
if (key
|
|
77
|
+
if (GEMINI_UNSUPPORTED_KEYWORDS.has(key)) continue;
|
|
71
78
|
// Gemini doesn't support anyOf/oneOf/allOf — flatten single-element unions,
|
|
72
79
|
// otherwise drop the keyword entirely (Gemini treats it as unknown).
|
|
73
80
|
if (key === 'anyOf' || key === 'oneOf' || key === 'allOf') {
|
|
74
81
|
if (Array.isArray(value) && value.length === 1) {
|
|
75
|
-
Object.assign(cleaned,
|
|
82
|
+
Object.assign(cleaned, sanitizeSchemaForLLM(value[0]));
|
|
76
83
|
}
|
|
77
84
|
// Multi-element unions are unsupported; skip the keyword
|
|
78
85
|
continue;
|
|
79
86
|
}
|
|
80
|
-
cleaned[key] =
|
|
87
|
+
cleaned[key] = sanitizeSchemaForLLM(value);
|
|
81
88
|
}
|
|
82
89
|
return cleaned;
|
|
83
90
|
}
|
|
@@ -92,7 +99,7 @@ export function formatToolsForProvider(provider, mcpTools) {
|
|
|
92
99
|
functionDeclarations: mcpTools.map((t) => ({
|
|
93
100
|
name: t.name,
|
|
94
101
|
description: t.description,
|
|
95
|
-
parameters:
|
|
102
|
+
parameters: sanitizeSchemaForLLM(t.inputSchema),
|
|
96
103
|
})),
|
|
97
104
|
}];
|
|
98
105
|
case 'openai':
|
|
@@ -100,13 +107,13 @@ export function formatToolsForProvider(provider, mcpTools) {
|
|
|
100
107
|
type: 'function',
|
|
101
108
|
name: t.name,
|
|
102
109
|
description: t.description,
|
|
103
|
-
parameters: t.inputSchema,
|
|
110
|
+
parameters: sanitizeSchemaForLLM(t.inputSchema),
|
|
104
111
|
}));
|
|
105
112
|
case 'anthropic':
|
|
106
113
|
return mcpTools.map((t) => ({
|
|
107
114
|
name: t.name,
|
|
108
115
|
description: t.description,
|
|
109
|
-
input_schema: t.inputSchema,
|
|
116
|
+
input_schema: sanitizeSchemaForLLM(t.inputSchema),
|
|
110
117
|
}));
|
|
111
118
|
default:
|
|
112
119
|
return mcpTools;
|
|
@@ -31,9 +31,14 @@ export async function connectMcp(configPath) {
|
|
|
31
31
|
|
|
32
32
|
const client = new Client({ name: 'archal-harness-agent', version: '1.0.0' });
|
|
33
33
|
|
|
34
|
+
// Build requestInit with auth headers from config (required for cloud-hosted twins).
|
|
35
|
+
const requestInit = serverConfig.headers && Object.keys(serverConfig.headers).length > 0
|
|
36
|
+
? { headers: serverConfig.headers }
|
|
37
|
+
: undefined;
|
|
38
|
+
|
|
34
39
|
// Try StreamableHTTP first (modern MCP transport)
|
|
35
40
|
try {
|
|
36
|
-
const transport = new StreamableHTTPClientTransport(new URL(mcpUrl));
|
|
41
|
+
const transport = new StreamableHTTPClientTransport(new URL(mcpUrl), { requestInit });
|
|
37
42
|
await client.connect(transport);
|
|
38
43
|
return { client, serverName };
|
|
39
44
|
} catch {
|
|
@@ -42,7 +47,7 @@ export async function connectMcp(configPath) {
|
|
|
42
47
|
|
|
43
48
|
// Fall back to SSE transport
|
|
44
49
|
try {
|
|
45
|
-
const transport = new SSEClientTransport(new URL(mcpUrl));
|
|
50
|
+
const transport = new SSEClientTransport(new URL(mcpUrl), { requestInit });
|
|
46
51
|
await client.connect(transport);
|
|
47
52
|
return { client, serverName };
|
|
48
53
|
} catch (err) {
|
|
@@ -125,7 +125,26 @@ export async function callToolRest(toolToTwin, namespacedName, args) {
|
|
|
125
125
|
});
|
|
126
126
|
const body = await res.text();
|
|
127
127
|
if (!res.ok) {
|
|
128
|
-
|
|
128
|
+
let capabilityMiss;
|
|
129
|
+
let message = `Tool call ${mapping.originalName} failed (HTTP ${res.status}): ${body}`;
|
|
130
|
+
|
|
131
|
+
try {
|
|
132
|
+
const parsed = JSON.parse(body);
|
|
133
|
+
if (parsed && typeof parsed === 'object' && parsed['capabilityMiss']) {
|
|
134
|
+
capabilityMiss = parsed['capabilityMiss'];
|
|
135
|
+
}
|
|
136
|
+
if (parsed && typeof parsed === 'object' && typeof parsed['message'] === 'string') {
|
|
137
|
+
message = `Tool call ${mapping.originalName} failed (HTTP ${res.status}): ${parsed['message']}`;
|
|
138
|
+
}
|
|
139
|
+
} catch {
|
|
140
|
+
// Non-JSON error body; keep the raw message.
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const error = new Error(message);
|
|
144
|
+
if (capabilityMiss) {
|
|
145
|
+
error.capabilityMiss = capabilityMiss;
|
|
146
|
+
}
|
|
147
|
+
throw error;
|
|
129
148
|
}
|
|
130
149
|
return body;
|
|
131
150
|
}
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { callToolRest } from './rest-client.mjs';
|
|
7
7
|
|
|
8
|
+
function shouldBailForCapabilityMiss(capabilityMiss) {
|
|
9
|
+
return capabilityMiss?.miss?.severity === 'high';
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
/**
|
|
9
13
|
* Execute an array of tool calls via REST, tracking errors and logging.
|
|
10
14
|
*
|
|
@@ -53,6 +57,14 @@ export async function executeToolCalls(toolCalls, opts) {
|
|
|
53
57
|
log.toolError(step, tc.name, err.message);
|
|
54
58
|
process.stderr.write(`[${harnessName}] Tool error (${counters.consecutiveErrors}): ${err.message}\n`);
|
|
55
59
|
|
|
60
|
+
if (shouldBailForCapabilityMiss(err.capabilityMiss)) {
|
|
61
|
+
process.stderr.write(
|
|
62
|
+
`[${harnessName}] Capability miss requires immediate stop: ${err.capabilityMiss.miss?.subkind ?? 'unknown'}\n`,
|
|
63
|
+
);
|
|
64
|
+
bailout = true;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
|
|
56
68
|
if (maxConsecutiveErrors > 0 && counters.consecutiveErrors >= maxConsecutiveErrors) {
|
|
57
69
|
process.stderr.write(`[${harnessName}] Too many consecutive tool errors — stopping.\n`);
|
|
58
70
|
bailout = true;
|