Skip to content

Commit 10a9252

Browse files
authored
Merge pull request #474 from codecrafters-io/fix-stages-for-llm-referencing-rule-tropicolx
Fix stages that don't follow the LLM referencing rule
2 parents 850bbab + 70ae4bc commit 10a9252

20 files changed

+34
-32
lines changed

stage_descriptions/base-03-wy1.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Redis clients to send multiple commands using the same connection.
88
For this stage, your server should run a loop that continuously reads commands and sends responses back through the same connection. Since we're only dealing with the `PING` command for now, your program can run a loop that reads input and responds with `+PONG\r\n`.
99

1010
{{#lang_is_javascript}}
11-
In most languages, you'd need to write specific code to run this loop on your server. In JavaScript, however, if you're listening to the [`data`](https://nodejs.org/api/net.html#net_event_data) event, this should be automatically handled for you. **It is very likely that the code you used in the previous stage will pass this stage without any changes!**
11+
In most languages, you'd need to write specific code to run this loop on your server. In JavaScript, however, if you're listening to the [`data`](https://nodejs.org/api/net.html#net_event_data) event, this should be automatically handled for you. **It is very likely that the code you used in previous stages will pass this stage without any changes!**
1212
{{/lang_is_javascript}}
1313

1414
{{#lang_is_typescript}}
15-
In most languages, you'd need to write specific code to run this loop on your server. In JavaScript, however, if you're listening to the [`data`](https://nodejs.org/api/net.html#net_event_data) event, this should be automatically handled for you. **It is very likely that the code you used in the previous stage will pass this stage without any changes!**
15+
In most languages, you'd need to write specific code to run this loop on your server. In JavaScript, however, if you're listening to the [`data`](https://nodejs.org/api/net.html#net_event_data) event, this should be automatically handled for you. **It is very likely that the code you used in previous stages will pass this stage without any changes!**
1616
{{/lang_is_typescript}}
1717

1818

@@ -24,7 +24,9 @@ The tester will execute your program like this:
2424
$ ./your_program.sh
2525
```
2626

27-
It will then send multiple `PING` commands using the same connection. For example, it might send:
27+
It will then send multiple `PING` commands using the same connection.
28+
29+
For example, it might send:
2830

2931
```bash
3032
$ echo -e "PING\nPING" | redis-cli

stage_descriptions/base-04-zu2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ In most languages, you'd need to either use threads or implement an
99
[Event Loop](https://en.wikipedia.org/wiki/Event_loop) to do this. In JavaScript, however, since [the concurrency
1010
model itself is based on an event loop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop), most
1111
standard library functions are designed to support this kind of concurrent behaviour out of the box. **It is very
12-
likely that the code you had for the previous stage will pass this stage without any changes!**
12+
likely that the code you had for previous stages will pass this stage without any changes!**
1313
{{/lang_is_javascript}}
1414

1515
{{#lang_is_typescript}}
1616
In most languages, you'd need to either use threads or implement an [Event Loop](https://en.wikipedia.org/wiki/Event_loop) to do this. In JavaScript, however, since [the concurrency
17-
model itself is based on an event loop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop), most standard library functions are designed to support this kind of concurrent behaviour out of the box. **It is very likely that the code you had for the previous stage will pass this stage without any changes!**
17+
model itself is based on an event loop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop), most standard library functions are designed to support this kind of concurrent behaviour out of the box. **It is very likely that the code you had for previous stages will pass this stage without any changes!**
1818
{{/lang_is_typescript}}
1919

2020
{{^lang_is_javascript}}

stage_descriptions/base-06-la7.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ The tester will expect to receive `$3\r\nbar\r\n` as a response. That's the stri
4848

4949
### Notes
5050

51-
- If you implemented a proper RESP parser in the previous stage, you should be able to reuse it in this stage.
52-
- Just like the previous stage, the values used for keys and values will be random, so you won't be able to hardcode the response to pass this stage.
53-
- If a key doesn't exist, the `GET` command should return a [null bulk string](https://redis.io/docs/latest/develop/reference/protocol-spec/#null-bulk-strings) (`$-1\r\n`). We won't explicitly test this in this stage, but you'll need it for the next stage.
51+
- If you implemented a proper RESP parser in previous stages, you should be able to reuse it in this stage.
52+
- Just like previous stages, the keys and values will be random, so you won't be able to hardcode the response to pass this stage.
53+
- If a key doesn't exist, the `GET` command should return a [null bulk string](https://redis.io/docs/latest/develop/reference/protocol-spec/#null-bulk-strings) (`$-1\r\n`). We won't explicitly test this in this stage, but you'll need it in later stages.

stage_descriptions/lists-04-sf6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ c\r\n
6969

7070
### Notes
7171

72-
- In this stage, you will only implement `LRANGE` with non-negative indexes. We will get to handling `LRANGE` for negative indexes in the next stage.
72+
- In this stage, you will only implement `LRANGE` with non-negative indexes. We will get to handling `LRANGE` for negative indexes in later stages.
7373
- If a list doesn't exist, `LRANGE` should respond with an empty RESP array (`*0\r\n`).

stage_descriptions/lists-10-ec3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If the list is empty, the command blocks until:
88

99
- A new element is added to the list
1010
- Or a specified timeout is reached.
11-
11+
1212
If the timeout is `0`, the command blocks indefinitely.
1313

1414
For example, a client can block on a list with an indefinite timeout like this:
@@ -88,4 +88,4 @@ The tester will expect your server to respond to the client that sent the `BLPOP
8888

8989
### Notes
9090

91-
- In this stage, the timeout argument will always be `0`, meaning `BLPOP` should wait indefinitely. We'll handle non-zero timeouts in a later stage.
91+
- In this stage, the timeout argument will always be `0`, meaning `BLPOP` should wait indefinitely. We'll handle non-zero timeouts in later stages.

stage_descriptions/lists-11-xj7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $ redis-cli BLPOP list_key 0.5
99
# (Blocks for 0.5 seconds)
1010
```
1111

12-
If an element is not available on the list within this time, the server returns a [null array](https://redis.io/docs/latest/develop/reference/protocol-spec/#null-arrays) (`*-1\r\n`). If an element is pushed to the list before the timeout, the command unblocks and returns the list key and the popped element as a RESP array, just as in the previous stage.
12+
If an element is not available on the list within this time, the server returns a [null array](https://redis.io/docs/latest/develop/reference/protocol-spec/#null-arrays) (`*-1\r\n`). If an element is pushed to the list before the timeout, the command unblocks and returns the list key and the popped element as a RESP array, just like with previous stages.
1313

1414
### Tests
1515

stage_descriptions/persistence-rdb-03-gc6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
In this stage, you'll add support for reading the value corresponding to a key from an RDB file.
22

3-
Just like with the previous stage, we'll stick to supporting RDB files that contain a single key for now.
3+
Just like with previous stages, we'll stick to supporting RDB files that contain a single key for now.
44

55
The tester will create an RDB file with a single key and execute your program like this:
66

stage_descriptions/replication-03-hc6.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ is a key-value pair separated by a colon (`:`). The tester will only look for th
3838

3939
### Notes
4040

41-
- Your program still needs to pass the previous stage tests, so if `--replicaof` isn't specified, you should default to the `master` role.
42-
- Just like the last stage, you only need to support the `role` key in the response for this stage. We'll add support for the other keys in later stages.
41+
- Your program still needs to pass the tests for previous stages, so if `--replicaof` isn't specified, you should default to the `master` role.
42+
- Just like the previous stages, you only need to support the `role` key in the response for this stage. We'll add support for the other keys in later stages.
4343
- You don't need to actually connect to the master server specified via `--replicaof` in this stage. We'll get to that in later stages.

stage_descriptions/replication-04-xc1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ Your program should respond with a [bulk string](https://redis.io/docs/latest/de
3939

4040
### Notes
4141

42-
- Your code must pass previous stage tests, meaning you should still return the correct `role` key.
42+
- Your code must pass the tests for previous stages, meaning you should still return the correct `role` key.

stage_descriptions/replication-06-eh4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In this stage, you'll implement the second step of the replication handshake.
44

55
As a recap, there are three steps to the handshake:
66

7-
1. The replica sends a `PING` to the master (Handled in the previous stage)
7+
1. The replica sends a `PING` to the master (Handled in previous stages)
88
2. The replica sends `REPLCONF` twice to the master
99
3. The replica sends `PSYNC` to the master
1010

0 commit comments

Comments
 (0)