qualiow-exploratory-testing 2.3.0 → 2.3.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.
Files changed (37) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +80 -0
  4. package/README.md +20 -13
  5. package/agents/qa-bug-judge.md +1 -1
  6. package/agents/qa-diff-indexer-agent.md +1 -1
  7. package/agents/qa-gather-agent.md +1 -1
  8. package/agents/qa-reporting-agent.md +1 -1
  9. package/bin/mobile-cli.mjs +74 -26
  10. package/bin/qualiow +7 -2
  11. package/bin/wk-ios +60 -6
  12. package/bin/wkeval.mjs +7 -2
  13. package/dist/cli/index.js +718 -172
  14. package/dist/index.d.ts +63 -19
  15. package/dist/index.js +586 -136
  16. package/docs/GETTING-STARTED.md +19 -9
  17. package/docs/MOBILE-SETUP.md +31 -0
  18. package/hooks/hooks.json +12 -2
  19. package/hooks/scripts/bash-guard.mjs +242 -0
  20. package/hooks/scripts/secret-patterns.d.mts +4 -1
  21. package/hooks/scripts/secret-patterns.mjs +126 -34
  22. package/hooks/scripts/write-guard.mjs +70 -15
  23. package/package.json +1 -1
  24. package/skills/qa-explore/SKILL.md +1 -1
  25. package/skills/qa-explore/references/evidence-triage.md +44 -12
  26. package/skills/qa-explore/references/output-contract.md +1 -1
  27. package/skills/qa-explore/references/security-rules.md +14 -2
  28. package/skills/qa-explore-cleanup/SKILL.md +1 -1
  29. package/skills/qa-explore-mobile/SKILL.md +13 -3
  30. package/skills/qa-explore-mobile/references/mobile-edges.md +3 -1
  31. package/skills/qa-explore-quick/SKILL.md +1 -1
  32. package/skills/qa-explore-report/SKILL.md +1 -1
  33. package/skills/qa-gather/SKILL.md +1 -1
  34. package/skills/qa-knowledge-add/SKILL.md +1 -1
  35. package/skills/qa-knowledge-list/SKILL.md +1 -1
  36. package/skills/qa-verify-backend/SKILL.md +1 -1
  37. package/skills/qa-verify-backend/phases/05-reporting.md +2 -1
package/dist/index.d.ts CHANGED
@@ -920,6 +920,11 @@ declare const KnowledgeChangelogSchema: z.ZodObject<{
920
920
  * require an actual `=` or `:` operator so ordinary prose ("Password field
921
921
  * accepts…", "the secret sauce") is left intact; card numbers are only redacted
922
922
  * when they pass a Luhn check, so millisecond timestamps and order ids survive.
923
+ *
924
+ * `hooks/scripts/secret-patterns.mjs` carries the same list, regex for regex
925
+ * (`tests/unit/redact-hardening.test.ts` compares the sources). Every pattern
926
+ * must stay linear on adversarial input: a write-guard hook that times out
927
+ * fails open, so no unbounded quantifier may restart at every offset of a run.
923
928
  */
924
929
  interface RedactOptions {
925
930
  emails?: boolean;
@@ -1020,7 +1025,8 @@ declare function describeSessionDir(name: string): DiscoveredSessionDir | null;
1020
1025
  *
1021
1026
  * Splits pipe-delimited rows and drops only the leading/trailing empty cells
1022
1027
  * produced by the outer pipes — internal empty cells are preserved, so column
1023
- * indices stay aligned even when a cell is blank.
1028
+ * indices stay aligned even when a cell is blank. An escaped pipe (`\|`) is cell
1029
+ * content, not a delimiter, as in GFM.
1024
1030
  */
1025
1031
  interface ParsedTable {
1026
1032
  headers: string[];
@@ -1536,8 +1542,16 @@ interface EvidenceFile {
1536
1542
  lines: number;
1537
1543
  text: string;
1538
1544
  truncated_from?: number;
1545
+ /** The file was larger than the read window: `truncated_from` is a lower bound. */
1546
+ partial?: boolean;
1539
1547
  }
1540
- type EvidenceSkipReason = 'image' | 'missing' | 'type' | 'outside-session' | 'excluded' | 'budget';
1548
+ /**
1549
+ * `outside-session` also covers a symlink whose target leaves the session;
1550
+ * `auth-state` is anything under `.auth/` (by name or by real path) or a file
1551
+ * shaped like a Playwright storage state; `not-file` is a directory, FIFO,
1552
+ * device or anything else that is not a regular file.
1553
+ */
1554
+ type EvidenceSkipReason = 'image' | 'missing' | 'type' | 'outside-session' | 'excluded' | 'auth-state' | 'not-file' | 'budget';
1541
1555
  interface EvidenceSkipped {
1542
1556
  file: string;
1543
1557
  reason: EvidenceSkipReason;
@@ -1600,9 +1614,9 @@ interface TriageResult {
1600
1614
  mode: TriageMode;
1601
1615
  model: string;
1602
1616
  createdAt: string;
1603
- request: {
1617
+ /** The exact request body sent (state, model, questions, and `max_len` for Laya). */
1618
+ request: SystemOneRequest & {
1604
1619
  state: TriageState;
1605
- questions: Record<string, TriageQuestion>;
1606
1620
  };
1607
1621
  response: SystemOneResponse | null;
1608
1622
  usage: TriageUsage | null;
@@ -1637,7 +1651,9 @@ interface TriageResult {
1637
1651
  * then `.env`);
1638
1652
  * - `laya` (self-hosted) must point at a loopback endpoint.
1639
1653
  * `--provider` only narrows the target's own list; it can never add a provider
1640
- * the target did not name. What leaves the machine is written verbatim to
1654
+ * the target did not name. The card must resolve (symlinks included) to
1655
+ * `<cwd>/output/sessions/<dir>/verification/claims/CLAIM-NNN.md` in a real
1656
+ * session directory. What leaves the machine is written verbatim to
1641
1657
  * `verification/<STEM>-NNN.json`; the human block goes to `<STEM>-NNN.md`.
1642
1658
  *
1643
1659
  * Exit codes: 0 triaged (or --dry-run) · 1 usage / unparseable card ·
@@ -1725,6 +1741,12 @@ declare function combineRoutes(routes: Route[]): Route;
1725
1741
  * Redirects are refused: a 307/308 would re-send the body to wherever the
1726
1742
  * server points, which defeats both the fixed hosted endpoint and the
1727
1743
  * loopback-only rule for Laya.
1744
+ *
1745
+ * The response is untrusted: its text ends up in stdout and in the
1746
+ * `<STEM>-NNN.md` block the Phase 7 agent reads. `assertResponse()` keeps
1747
+ * only the fields the question set asked for, allow-lists every `choice`,
1748
+ * clamps every probability to [0, 1] and flattens the model id; the body is
1749
+ * read with a byte limit before it is parsed.
1728
1750
  */
1729
1751
 
1730
1752
  declare const JEV_ENDPOINT = "https://api.typesafe.ai/v1/systemone";
@@ -1756,7 +1778,14 @@ interface CallResult {
1756
1778
  /** 500 ms, 1 s, 2 s … plus up to 250 ms of jitter. */
1757
1779
  declare function backoffMs(attempt: number, random?: () => number): number;
1758
1780
  declare function callSystemOne(req: SystemOneRequest, opts: CallOptions): Promise<CallResult>;
1759
- /** Every requested question must be answered with the type it was asked as. */
1781
+ /**
1782
+ * Every requested question must be answered with the type it was asked as.
1783
+ * What comes back is rebuilt from the question set, never passed through:
1784
+ * answers to questions that were not asked and unknown fields are dropped, a
1785
+ * `choice` outside the question's criteria keys is malformed, probabilities
1786
+ * are kept only for those keys and clamped to [0, 1], the model id is one
1787
+ * sanitised line of at most 64 characters.
1788
+ */
1760
1789
  declare function assertResponse(json: unknown, questions: Record<string, TriageQuestion>): SystemOneResponse;
1761
1790
  declare const LAYA_DEFAULT_ENDPOINT = "http://127.0.0.1:8000/v1/systemone";
1762
1791
  declare const LAYA_DEFAULT_MODEL = "multilingual";
@@ -1788,23 +1817,31 @@ declare function parseVerdictBlock(content: string): ParsedVerdict;
1788
1817
  *
1789
1818
  * `redact()` is the pack's secret list and is shared with the write guard, so
1790
1819
  * it must not learn URL, host or path rules (`tests/unit/hooks.test.ts` pins
1791
- * that parity). This module composes it: secrets first, then every URL is
1792
- * reduced to its path, every dotted hostname to `[HOST]` and every absolute
1793
- * path under a common root (`/Users`, `/home`, `/tmp`, `/srv`, `/workspace`, a
1794
- * drive letter, …) to its basename. A path under any other root passes
1795
- * through: a generic rule would also eat the `[URL /path]` tokens kept on
1796
- * purpose. The path of a URL carries the signal a triage needs (which screen);
1797
- * the host does not.
1820
+ * that parity). This module composes it: secrets first, then every URL (any
1821
+ * `scheme://`, JSON-escaped `scheme:\/\/` too) is reduced to its path, every
1822
+ * dotted hostname to `[HOST]` (a scheme-less `host.tld/path?query` keeps the
1823
+ * path and loses the query) and every absolute path under a common root
1824
+ * (`/Users`, `/home`, `/tmp`, `/srv`, `/workspace`, a drive letter, …) to its
1825
+ * basename. A path under any other root passes through: a generic rule would
1826
+ * also eat the `[URL /path]` tokens kept on purpose. The path of a URL carries
1827
+ * the signal a triage needs (which screen); the host does not.
1798
1828
  *
1799
1829
  * Pattern-based, so it has gaps, and the docs state them: IP addresses,
1800
1830
  * single-label hostnames (`intranet`), URL paths (kept on purpose, and they can
1801
1831
  * name a customer or an internal service) and free-text product, company or
1802
1832
  * people names all pass through unchanged. The exact request is saved next to
1803
1833
  * the verdict so a human can see what was sent.
1834
+ *
1835
+ * Every pattern here is bounded so hostile page text cannot stall the scrub.
1836
+ * A run of more than `LONG_RUN` token characters (`[A-Za-z0-9._%+-]` with no
1837
+ * separator) is replaced whole before `redact()` sees it: some of its rules
1838
+ * are quadratic on such runs, and nothing a triage needs is that long.
1839
+ * Callers cap each field first (`capForScrub()`); `scrubForTransmission()`
1840
+ * itself never looks past `MAX_SCRUB_CHARS`.
1804
1841
  */
1805
1842
  interface ScrubResult {
1806
1843
  text: string;
1807
- /** `redact()` categories plus 'URL', 'Host' and 'Path' when they fired. */
1844
+ /** `redact()` categories plus 'URL', 'Host', 'Path' and 'Long token' when they fired. */
1808
1845
  redactions: string[];
1809
1846
  }
1810
1847
  declare function scrubForTransmission(text: string): ScrubResult;
@@ -1827,9 +1864,14 @@ declare const DEFAULT_EVIDENCE_MAX_LINES = 120;
1827
1864
  declare const MAX_STATE_CHARS = 96000;
1828
1865
  declare const MAX_PATTERNS = 12;
1829
1866
  declare const EVIDENCE_NOTE: string;
1830
- /** `verification/claims/CLAIM-NNN.md` → the session directory. */
1867
+ /** `verification/claims/CLAIM-NNN.md` → the session directory, by position only. */
1831
1868
  declare function sessionDirOfClaim(claimFile: string): string;
1832
- declare function collectEvidence(claim: ParsedClaim, claimFile: string, maxLines?: number): CollectedEvidence;
1869
+ /**
1870
+ * The text files a card lists, read under the containment rules. `sessionDir`
1871
+ * is the directory `resolveClaimLocation()` validated; without it the
1872
+ * directory is taken from the card's position (tests, library callers).
1873
+ */
1874
+ declare function collectEvidence(claim: ParsedClaim, claimFile: string, maxLines?: number, sessionDir?: string): CollectedEvidence;
1833
1875
  /**
1834
1876
  * The bold lead-ins of the "False Positive" sections of `learned-patterns.md`
1835
1877
  * (project copy first, then the resolved data dir) plus the session's own
@@ -1842,9 +1884,11 @@ declare function buildTriageState(claim: ParsedClaim, evidence: CollectedEvidenc
1842
1884
  redactions: string[];
1843
1885
  };
1844
1886
  /**
1845
- * Keeps the serialised state under `maxChars`, halving the last evidence file
1846
- * first and dropping it (reason `budget`) when it is down to a stub. Returns the
1847
- * evidence metadata as it stands after the cut.
1887
+ * Keeps the serialised state under `maxChars`: first the last evidence file is
1888
+ * halved, then dropped (reason `budget`) once it is down to a stub; with no
1889
+ * evidence file left, `evidence_inline`, `actual`, the longest step and
1890
+ * `expected` are halved in that order, down to a floor. Returns the evidence
1891
+ * metadata as it stands after the cut.
1848
1892
  */
1849
1893
  declare function fitStateToBudget(state: TriageState, evidence: CollectedEvidence, maxChars?: number): {
1850
1894
  sent: Array<Omit<EvidenceFile, 'text'>>;