@danypops/papyrus 0.50.1 → 0.50.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danypops/papyrus",
3
- "version": "0.50.1",
3
+ "version": "0.50.2",
4
4
  "description": "Daemon-backed graph artifacts, evidence-bearing tasks, rules, skills, and native TUI workflows for Pi",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -99,12 +99,14 @@ export function listScoped(
99
99
  }
100
100
  const projectRoot = normalizeProjectRoot(filter.projectRoot);
101
101
  const ids = scopes.ids(projectRoot, ARTIFACT_SCOPE_MAX_ARTIFACTS);
102
- const text = filter.text?.toLowerCase();
103
- return ids
104
- .map((id) => artifacts.get(id))
105
- .filter((artifact): artifact is Artifact => artifact?.kind === kind && artifact.subtype !== excludeSubtype)
106
- .filter((artifact) => filter.status === undefined || artifact.status === filter.status)
107
- .filter((artifact) => text === undefined || artifact.title.toLowerCase().includes(text) || artifact.body.toLowerCase().includes(text))
102
+ if (ids.length === 0) return [];
103
+ // artifacts.query (not a manual ids.map(artifacts.get)) so a trashed member is excluded the
104
+ // same way every other listing path already excludes trash by default -- a real, confirmed
105
+ // bug live-verifying this feature: artifacts.get() has no trash awareness at all, so a
106
+ // project-scoped listing kept surfacing an artifact for weeks after artifact.remove trashed
107
+ // it, while the unscoped and applicable branches (both already query-backed) never did.
108
+ return artifacts
109
+ .query({ ids, kind, excludeSubtype, status: filter.status, text: filter.text })
108
110
  .sort((left, right) => right.updated_at.localeCompare(left.updated_at) || left.id.localeCompare(right.id))
109
111
  .slice(0, limit);
110
112
  }