# Expected substrings for the MongoDB integ run (integ/mongodb.py).
# Matched as fixed substrings by integ/check_lines.sh, so volatile output
# (index $indexStats timestamps, system.views internal collection, stat sizes)
# is tolerated. Seed data is fixed (integer _ids) so content is deterministic.

# ---- directory structure (ls / tree) ----
mirage_integ
collections
views
database.json
documents.jsonl
schema.json
authors
books
recent_books

# ---- database.json ----
"database": "mirage_integ"
"name": "authors", "document_count": 3
"name": "books", "document_count": 5
"views": [{"name": "recent_books"}]

# ---- schema.json sampled fields (volatile index stats ignored) ----
"name": "books", "kind": "collection"
"path": "author"
"path": "rating"
"path": "tags"
"path": "title"
"path": "year"
"primary_key": "_id"
"sampled": 100

# ---- documents (cat / head / tail / view) ----
"title": "alpha", "author": "ada"
"title": "beta", "author": "ben"
"title": "gamma", "author": "cara"
"title": "delta", "author": "ada"
"title": "epsilon", "author": "ben"
{"_id": 1, "name": "ada", "books": 2}

# ---- wc (GNU layout: right-aligned space-separated counts) ----
5 /mongodb/mirage_integ/collections/books/documents.jsonl
# default mode pads to the byte-count width; byte total differs per
# language (python renders 4.0, JS renders 4), so match the stable prefix
  5  57 4

# ---- stat ----
name=documents.jsonl

# ---- grep / rg at db + root scope (search push-down, path-prefixed) ----
mirage_integ/collections/authors/documents.jsonl:
mirage_integ/collections/books/documents.jsonl:

# ---- find ----
/mongodb/mirage_integ/collections/books/documents.jsonl
/mongodb/mirage_integ/collections/books/schema.json
/mongodb/mirage_integ/views/recent_books/documents.jsonl

# ---- safeguard demo (cat cap=2 lines) ----
=== safeguard_cat_truncates ===
"title": "alpha"
"title": "beta"
output truncated at safeguard limit (2 lines)
=== safeguard_cat_pipe_uncapped ===
5 /mongodb/mirage_integ/collections/books/documents.jsonl

# ---- grep -e multi-pattern (newline-joined list, no search push-down) ----
=== grep_e_multi ===
1:{"_id": 1, "title": "alpha", "author": "ada"
2:{"_id": 2, "title": "beta", "author": "ben"
4:{"_id": 4, "title": "delta", "author": "ada"
5:{"_id": 5, "title": "epsilon", "author": "ben"
=== grep_r_e_multi ===
/mongodb/mirage_integ/collections/books/documents.jsonl:{"_id": 1, "title": "alpha"
/mongodb/mirage_integ/collections/books/documents.jsonl:{"_id": 2, "title": "beta"
=== rg_e_multi ===
/mongodb/mirage_integ/collections/books/documents.jsonl:{"_id": 3, "title": "gamma"
=== nf_cat ===
exit=1
cat: /mongodb/__nf_missing__.txt: No such file or directory
=== nf_head ===
exit=1
head: /mongodb/__nf_missing__.txt: No such file or directory
=== nf_tail ===
exit=1
tail: /mongodb/__nf_missing__.txt: No such file or directory
=== nf_wc ===
exit=1
wc: /mongodb/__nf_missing__.txt: No such file or directory
=== nf_stat ===
exit=1
stat: /mongodb/__nf_missing__.txt: No such file or directory
=== nf_grep ===
exit=1
grep: /mongodb/__nf_missing__.txt: No such file or directory

# ---- tail -f change stream (live insert via PyMongo async watch) ----
=== tail_f_change_stream ===
"title": "live_insert"

# symlink to the database meta file (namespace links; read-only backend)
=== sym_ln ===
=== sym_readlink ===
/mongodb/mirage_integ/database.json
=== sym_cat ===
=== sym_ls ===
meta_link@
=== sym_rm ===
=== prov_probe_cat ===
net=0 write=0 cache=0 ops=1 hits=0 precision=unknown
=== prov_probe_grep ===
net=0 write=0 cache=0 ops=1 hits=0 precision=unknown
=== prov_probe_ls ===
net=0 write=0 cache=0 ops=1 hits=0 precision=exact

# ---- sed (streaming works on the read-only mount; -i is rejected) ----
=== sed_stream_1p ===
=== sed_i_readonly ===
sed: -i not supported on this backend: Permission denied
